Skip to content

Commit 0c6a40d

Browse files
authored
Merge pull request #681 from opendatacube/improve-docker-compose
enable docker-compose to mnt external config
2 parents 8967197 + 8ae99e9 commit 0c6a40d

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

.env_ows_root

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ DB_PORT=5432
66
DB_USERNAME=opendatacubeusername
77
DB_PASSWORD=opendatacubepassword
88
DB_DATABASE=opendatacube
9-
OWS_CFG_FILE=./ows_refactored/dev_af_ows_root_cfg.py
9+
OWS_CFG_FILE=ows_refactored/ows_root_cfg.py
10+
# OWS_CFG_FOLDER config enables mounting an external CFG folder
11+
OWS_CFG_FOLDER=~/dea-config/dev/services/wms/ows_refactored
12+
# OWS_CFG_CONTAINER_FOLDER defines the mount inside docker container
13+
OWS_CFG_COUNTAINER_FOLDER=/env/config/ows_refactored
1014
AWS_NO_SIGN_REQUEST=yes
1115
AWS_S3_ENDPOINT=
1216
# If you want to use pydev for interactive debugging
1317
PYDEV_DEBUG=
1418
# Will not work with pydev
1519
FLASK_ENV=development
1620
prometheus_multiproc_dir=/tmp
17-
PYTHONPATH=/code
18-
DATACUBE_OWS_CFG=ows_refactored.dev_af_ows_root_cfg.ows_cfg
21+
PYTHONPATH=/env/config
22+
DATACUBE_OWS_CFG=ows_refactored.ows_root_cfg.ows_cfg

.env_simple

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ DB_PORT=5432
66
DB_USERNAME=opendatacubeusername
77
DB_PASSWORD=opendatacubepassword
88
DB_DATABASE=opendatacube
9-
OWS_CFG_FILE=./integration_tests/cfg/ows_test_cfg.py
9+
OWS_CFG_FILE=config/ows_test_cfg.py
10+
# OWS_CFG_FOLDER config enables mounting an external CFG folder
11+
OWS_CFG_FOLDER=./integration_tests/cfg
12+
# OWS_CFG_CONTAINER_FOLDER defines the mount inside docker container
13+
OWS_CFG_CONTAINER_FOLDER=/env/config
1014
AWS_NO_SIGN_REQUEST=yes
1115
AWS_S3_ENDPOINT=
1216
# If you want to use pydev for interactive debugging
@@ -15,4 +19,4 @@ PYDEV_DEBUG=
1519
FLASK_ENV=development
1620
prometheus_multiproc_dir=/tmp
1721
PYTHONPATH=/env
18-
DATACUBE_OWS_CFG=config.ows_cfg.ows_cfg
22+
DATACUBE_OWS_CFG=config.ows_test_cfg.ows_cfg

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
DB_PASSWORD: ${DB_PASSWORD}
2525
DB_DATABASE: ${DB_DATABASE}
2626
# Where the config file is (must match the volume mount)
27-
WMS_CONFIG_PATH: /env/config/ows_cfg.py
27+
WMS_CONFIG_PATH: /env/config/${OWS_CFG_FILE}
2828
# Path from the PYTHONPATH to the config object (default PYTHONPATH is /env)
2929
PYTHONPATH: ${PYTHONPATH}
3030
DATACUBE_OWS_CFG: ${DATACUBE_OWS_CFG}
@@ -40,7 +40,7 @@ services:
4040
ports:
4141
- "8000:8000"
4242
volumes:
43-
- ${OWS_CFG_FILE}:/env/config/ows_cfg.py
43+
- ${OWS_CFG_FOLDER}:${OWS_CFG_CONTAINER_FOLDER}
4444
- ./docker/ows/wait-for-db:/usr/local/bin/wait-for-db
4545
- ./:/code/
4646
- ./artifacts:/mnt/artifacts

docs/environment_variables.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,18 @@ Docker and Docker-compose
107107
The provided ``Dockerfile`` and ``docker-compose.yaml`` read additional
108108
environment variables at build time. Please refer to the `README <https://datacube-ows.readthedocs.io/en/latest/readme.html>`_
109109
for further details.
110+
111+
environment variables exclusive for docker-compose
112+
--------------------------------------------------
113+
OWS_CFG_FILE:
114+
for multiple files ows config structure, the root level ows config file path inside docker container
115+
for single file ows config structure, the ows config file path inside docker container
116+
117+
OWS_CFG_FOLDER:
118+
path to a folder containing ows config files anywhere on the local machine
119+
120+
OWS_CFG_COUNTAINER_FOLDER:
121+
path the OWS_CFG_FOLDER will mount to inside docker container
122+
123+
PYTHONPATH:
124+
PYTHONPATH to ows config file

0 commit comments

Comments
 (0)