diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index a6490967..92a5d1ea 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -30,7 +30,7 @@ services: - ${REMOTE_DEBUGGING_PORT:-5678}:5678 command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py migrate && ./manage.py create_superuser && ./manage.py create_example_users && @@ -49,7 +49,7 @@ services: image: adit_dev-default_worker:latest command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py bg_worker -l debug -q default --autoreload " @@ -58,7 +58,7 @@ services: image: adit_dev-dicom_worker:latest command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py bg_worker -l debug -q dicom --autoreload " @@ -67,7 +67,7 @@ services: image: adit_dev-mass_transfer_worker:latest command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py bg_worker -l debug -q mass_transfer --autoreload " diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 80c2744b..3f8549ea 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -23,7 +23,7 @@ services: hostname: init.local command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py migrate && ./manage.py collectstatic --no-input && ./manage.py create_superuser && @@ -58,7 +58,7 @@ services: <<: *default-app command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py bg_worker -q default " deploy: @@ -68,7 +68,7 @@ services: <<: *default-app command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py bg_worker -q dicom " deploy: @@ -79,7 +79,7 @@ services: <<: *default-app command: > bash -c " - wait-for-it -s postgres.local:5432 -t 60 && + wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && ./manage.py bg_worker -q mass_transfer " deploy: diff --git a/example.env b/example.env index 50feaafa..983c14ac 100644 --- a/example.env +++ b/example.env @@ -100,6 +100,10 @@ SSL_SERVER_CHAIN_FILE=./chain.pem # The timezone used by the server. TIME_ZONE=Europe/Berlin +# Seconds the web and worker containers wait for Postgres to accept connections +# before giving up on startup. +WAIT_POSTGRES_TIMEOUT=180 + # The calling AE title of ADIT. CALLING_AE_TITLE=ADIT1DEV