# HG changeset patch # User Sebastien Jodogne # Date 1620297460 -7200 # Node ID 767c2550fa00a4c29deba5e7b33a886eddab7192 # Parent 8bda16db46cf38cec8b428bfba92bf66cf5476db environment variable in docker compose diff -r 8bda16db46cf -r 767c2550fa00 Sphinx/source/users/configuration.rst --- a/Sphinx/source/users/configuration.rst Mon May 03 14:31:42 2021 +0200 +++ b/Sphinx/source/users/configuration.rst Thu May 06 12:37:40 2021 +0200 @@ -82,6 +82,8 @@ page `. +.. _orthanc-environment-variables: + Environment variables --------------------- diff -r 8bda16db46cf -r 767c2550fa00 Sphinx/source/users/docker.rst --- a/Sphinx/source/users/docker.rst Mon May 03 14:31:42 2021 +0200 +++ b/Sphinx/source/users/docker.rst Thu May 06 12:37:40 2021 +0200 @@ -147,7 +147,7 @@ unfortunately it is only available to `Docker Swarm `__). -.. highlight:: yml +.. highlight:: yaml First create the ``docker-compose.yml`` file as follows (this one uses the `YAML file format `__):: @@ -161,7 +161,9 @@ - 4242:4242 - 8042:8042 secrets: - - orthanc.json + - orthanc.json + environment: + - ORTHANC_NAME=HelloWorld secrets: orthanc.json: file: orthanc.json @@ -172,7 +174,7 @@ ``docker-compose.yml`` file. Here is a minimalist ``orthanc.json``:: { - "Name" : "Orthanc in Docker", + "Name" : "${ORTHANC_NAME} in Docker Compose", "RemoteAccessAllowed" : true } @@ -184,7 +186,15 @@ $ docker-compose up +Note how the `environment variable +`__ +``ORTHANC_NAME`` has been used in order to easily adapt the +configuration of Orthanc. This results from the fact that Orthanc +injects :ref:`environment variables ` +once reading the content of its configuration files (since Orthanc +1.5.0). + Making the Orthanc database persistent -------------------------------------- @@ -261,7 +271,7 @@ $ docker inspect --format '{{ .NetworkSettings.Ports }}' some-postgres $ docker run --rm --entrypoint=cat jodogne/orthanc-plugins /etc/orthanc/orthanc.json > /tmp/orthanc.json -.. highlight:: json +.. highlight:: text Add the following section to ``/tmp/orthanc.json`` (adapting the values Host and Port to what docker inspect said above)::