diff --git a/docs/source/running-with-docker.rst b/docs/source/running-with-docker.rst index a9fd3f88d..6f0433f38 100644 --- a/docs/source/running-with-docker.rst +++ b/docs/source/running-with-docker.rst @@ -17,7 +17,7 @@ The basics The official pygeoapi Docker image will start a pygeoapi Docker container using Gunicorn on internal port 80. -Either ``IMAGE`` can be called with the ``docker`` command, ``geopython/pygeoapi`` from DockerHub or ``ghcr.io/geophython/pygeoapi`` from the GitHub Container Registry. Examples below use ``geopython/pygeoapi``. +Either ``IMAGE`` can be called with the ``docker`` command, ``geopython/pygeoapi`` from DockerHub or ``ghcr.io/geopython/pygeoapi`` from the GitHub Container Registry. Examples below use ``geopython/pygeoapi``. To run with the default built-in configuration and data: @@ -103,6 +103,32 @@ Below is a corresponding ``docker-compose`` approach: A corresponding example can be found in https://github.com/geopython/demo.pygeoapi.io/tree/master/services/pygeoapi_master +Deploying with Starlette +------------------------ + +By default the ``pygeoapi`` Docker image will run using ``Flask``. If you need to run using a +different framework, you can set the ``WSGI_APP_FRAMEWORK`` and ``WSGI_WORKER_CLASS`` environment variables. + +.. code-block:: bash + + docker run -p 5000:80 -e WSGI_APP_FRAMEWORK='pygeoapi.starlette_app:APP' -e WSGI_WORKER_CLASS='uvicorn.workers.UvicornH11Worker' -it geopython/pygeoapi + +Below is a corresponding ``docker-compose`` approach: + +.. code-block:: yaml + + version: "3" + services: + pygeoapi: + image: geopython/pygeoapi:latest + ports: + - "5000:80" + environment: + - WSGI_APP_FRAMEWORK=pygeoapi.starlette_app:APP + - WSGI_WORKER_CLASS=uvicorn.workers.UvicornH11Worker + +A corresponding example can be found in the pygeoapi examples. + Summary ------- diff --git a/docs/source/running.rst b/docs/source/running.rst index 3533d1ba8..8ea173f01 100644 --- a/docs/source/running.rst +++ b/docs/source/running.rst @@ -270,7 +270,7 @@ It is simple to run using the following command: .. code-block:: bash - gunicorn pygeoapi.starlette_app:app -w 4 -k uvicorn.workers.UvicornWorker + gunicorn pygeoapi.starlette_app:APP -w 4 -k uvicorn.workers.UvicornH11Worker .. note:: Uvicorn is as easy to install as ``pip3 install uvicorn``