Skip to content

Commit 31c28bb

Browse files
doublebyte1doublebyte1
andauthored
Docs update to reflect other environmental variables available in the docker image (#2047)
* - Added information about other environmental variables that are available in the docker image * - added missing backticks * - capitalised Gunicorn and put link on the first reference. * - fixed backticks - added backticks to 4 --------- Co-authored-by: doublebyte1 <info@doublebyte.net>
1 parent 4fba2a4 commit 31c28bb

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

docs/source/running-with-docker.rst

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `pygeoapi demo server`_ runs various services from Docker images which also
1515
The basics
1616
----------
1717

18-
The official pygeoapi Docker image will start a pygeoapi Docker container using Gunicorn on internal port 80.
18+
The official pygeoapi Docker image will start a pygeoapi Docker container using `Gunicorn <https://docs.gunicorn.org/en/latest/>`_ on internal port 80.
1919

2020
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``.
2121

@@ -102,6 +102,38 @@ The base Docker image supports two additional environment variables for configur
102102
103103
To learn more about the Admin API see :ref:`admin-api`.
104104

105+
3. **`CONTAINER_HOST`**:
106+
This variable sets the listening address for incoming connections. Normally the server is listening on ``localhost`` (the default), but other values are also possible.
107+
108+
.. code-block:: bash
109+
110+
docker run -p 5000:80 -e CONTAINER_HOST=192.168.0.7 -it geopython/pygeoapi
111+
112+
4. **`CONTAINER_PORT`**:
113+
This variable sets the listening port for incoming connections. The default port is ``80``; in this example, we change it to ``5001``.
114+
115+
.. code-block:: bash
116+
117+
docker run -p 5000:5001 -e CONTAINER_PORT=5001 -it geopython/pygeoapi
118+
119+
5. **`WSGI_WORKERS`**:
120+
121+
This variable sets the number of workers used by the Gunicorn server, the default being ``4``.
122+
For performance reasons, `it is not recommended to use a high number of workers <https://docs.gunicorn.org/en/latest/design.html#how-many-workers>`_ .
123+
124+
.. code-block:: bash
125+
126+
docker run -p 5000:80 -e WSGI_WORKERS=10 -it geopython/pygeoapi
127+
128+
6. **`WSGI_WORKER_TIMEOUT`**:
129+
130+
Gunicorn workers silent for more than the seconds set by this variable are killed and restarted. The default value is ``6000``.
131+
132+
.. code-block:: bash
133+
134+
docker run -p 5000:80 -e WSGI_WORKERS=10 -it geopython/pygeoapi
135+
136+
You can read more about this and other Gunicorn settings in the `official documentation <https://docs.gunicorn.org/en/stable/>`_
105137

106138
Deploying on a sub-path
107139
-----------------------

0 commit comments

Comments
 (0)