/example_fastapi_behind_apache_using_wsgi

example how to run FastApi behind Apache without reverse proxy using mod_wsgi

Primary LanguageDockerfile

Run FastApi behind Apache without reverse proxy

This is an example repository, to show how to run FastAPI behind Apache HTTP Server without reverse proxy, but using mod_wsgi with a venv and the WSGIMiddleware instead.

In some cases, it is not an option or not wanted to run a separate server process (like using Uvicorn).

This example is in a Docker container, so you can run it with:

> docker compose up

and check the result with:

> curl http://localhost:8080/
{"message":"Hello World 👋"}

… but it is more meant to be a documentation and one can install the same everywhere.

The image is based un Ubuntu 22.04 and uses Python 3.10. There is an alternative image based on the Red Hat Universal Base Images (UBI) 9 and Python 3.9 in the Dockerfile.redhat file.