Skip to content

Commit

Permalink
Update Starlette documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben committed Dec 27, 2023
1 parent 215d037 commit 8b7047e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
28 changes: 27 additions & 1 deletion docs/source/running-with-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
-------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down

0 comments on commit 8b7047e

Please sign in to comment.