Update docker configuration
This commit is contained in:
+10
-10
@@ -32,6 +32,8 @@ The configuration file must contain a set of key value pairs. At minimum you mus
|
||||
|
||||
The user specified in the db-uri is also known as the authenticator role. For more information about the anonymous vs authenticator roles see the :ref:`roles`.
|
||||
|
||||
.. _config_full_list:
|
||||
|
||||
Here is the full list of configuration parameters.
|
||||
|
||||
======================== ======= ================= ========
|
||||
@@ -65,8 +67,6 @@ role-claim-key String .role
|
||||
raw-media-types String
|
||||
======================== ======= ================= ========
|
||||
|
||||
You can also set these configuration parameters using environment variables. They are capitalized, have a ``PGRST_`` prefix, and use underscores. For example: ``PGRST_DB_URI`` corresponds to ``db-uri``.
|
||||
|
||||
.. _db-uri:
|
||||
|
||||
db-uri
|
||||
@@ -386,6 +386,13 @@ raw-media-types
|
||||
|
||||
raw-media-types="image/png, text/xml"
|
||||
|
||||
.. _env_variables_config:
|
||||
|
||||
Environment Variables
|
||||
=====================
|
||||
|
||||
You can also set these :ref:`configuration parameters <config_full_list>` using environment variables. They are capitalized, have a ``PGRST_`` prefix, and use underscores. For example: ``PGRST_DB_URI`` corresponds to ``db-uri`` and ``PGRST_APP_SETTINGS_*`` to ``app.settings.*``.
|
||||
|
||||
.. _config_reloading:
|
||||
|
||||
Configuration Reloading
|
||||
@@ -397,14 +404,7 @@ To reload the configuration without restarting the PostgREST server, send a SIGU
|
||||
|
||||
killall -SIGUSR2 postgrest
|
||||
|
||||
To reload the config in docker:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
docker kill -s SIGUSR2 <container>
|
||||
|
||||
# or in docker-compose
|
||||
docker-compose kill -s SIGUSR2 <service>
|
||||
This method does not reload :ref:`env_variables_config` and it will not work for reloading a Docker container configuration. In these cases, you need to restart the PostgREST server or use :ref:`in_db_config` as an alternative.
|
||||
|
||||
.. important::
|
||||
|
||||
|
||||
+2
-13
@@ -99,19 +99,7 @@ You can get the `official PostgREST Docker image <https://hub.docker.com/r/postg
|
||||
|
||||
docker pull postgrest/postgrest
|
||||
|
||||
The image consults an internal ``/etc/postgrest.conf`` file. To customize this file you can either mount a replacement configuration file into the container, or use environment variables. The environment variables will be interpolated into the default config file.
|
||||
|
||||
These variables match the options shown in our :ref:`configuration` section, except they are capitalized, have a ``PGRST_`` prefix, and use underscores. To get a list of the available environment variables, run this:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker inspect -f "{{.Config.Env}}" postgrest/postgrest
|
||||
|
||||
You can also specify a config file by mounting the file to the container:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker run -v /absolute/path/to/config:/etc/postgrest.conf postgrest/postgrest
|
||||
To configure the container image, use :ref:`env_variables_config`.
|
||||
|
||||
There are two ways to run the PostgREST container: with an existing external database, or through docker-compose.
|
||||
|
||||
@@ -125,6 +113,7 @@ The first way to run PostgREST in Docker is to connect it to an existing native
|
||||
# Run the server
|
||||
docker run --rm --net=host -p 3000:3000 \
|
||||
-e PGRST_DB_URI="postgres://postgres@localhost/postgres" \
|
||||
-e PGRST_DB_SCHEMA="public" \
|
||||
-e PGRST_DB_ANON_ROLE="postgres" \
|
||||
postgrest/postgrest
|
||||
|
||||
|
||||
@@ -127,6 +127,9 @@ Changed
|
||||
For more details, see `Docker image built with Nix <https://github.com/PostgREST/postgrest/tree/main/nix/tools/docker#user-content-docker-image-built-with-nix>`_.
|
||||
|br| -- `@monacoremo <https://github.com/monacoremo>`_
|
||||
|
||||
* The Docker image no longer has an internal ``/etc/postgrest.conf`` file, you must use :ref:`env_variables_config` to configure it.
|
||||
|br| -- `@wolfgangwalther <https://github.com/wolfgangwalther>`_
|
||||
|
||||
* The ``pg_listen`` `utility <https://github.com/begriffs/pg_listen>`_ is no longer needed to automatically reload the schema cache
|
||||
and it's replaced entirely by database notifications. See :ref:`schema_reloading_notify`.
|
||||
|br| -- `@steve-chavez <https://github.com/steve-chavez>`_
|
||||
|
||||
Reference in New Issue
Block a user