diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -79,6 +79,7 @@ swh-scheduler-db: image: postgres:11 env_file: + - ./env/common_python.env - ./env/scheduler-db.env environment: # unset PGHOST as db service crashes otherwise @@ -88,6 +89,7 @@ image: swh/stack build: ./ env_file: + - ./env/common_python.env - ./env/scheduler-db.env - ./env/scheduler.env environment: @@ -106,6 +108,7 @@ image: swh/stack build: ./ env_file: + - ./env/common_python.env - ./env/scheduler-db.env - ./env/scheduler.env environment: @@ -124,6 +127,7 @@ image: swh/stack build: ./ env_file: + - ./env/common_python.env - ./env/scheduler-db.env - ./env/scheduler.env environment: @@ -158,6 +162,7 @@ - swh-objstorage - kafka env_file: + - ./env/common_python.env - ./env/storage-db.env environment: SWH_CONFIG_FILENAME: /storage.yml @@ -174,6 +179,8 @@ image: swh/stack ports: - 5003:5003 + env_file: + - ./env/common_python.env environment: SWH_CONFIG_FILENAME: /objstorage.yml entrypoint: /entrypoint.sh @@ -199,6 +206,7 @@ depends_on: - swh-idx-storage-db env_file: + - ./env/common_python.env - ./env/indexers-db.env environment: SWH_CONFIG_FILENAME: /indexer_storage.yml @@ -218,6 +226,8 @@ - swh-objstorage - swh-storage - swh-idx-storage + env_file: + - ./env/common_python.env environment: VERBOSITY: 3 DJANGO_SETTINGS_MODULE: swh.web.settings.development @@ -243,12 +253,13 @@ depends_on: - swh-deposit-db - swh-scheduler-api + env_file: + - ./env/common_python.env + - ./env/deposit-db.env environment: VERBOSITY: 3 SWH_CONFIG_FILENAME: /deposit.yml DJANGO_SETTINGS_MODULE: swh.deposit.settings.production - env_file: - - ./env/deposit-db.env entrypoint: /entrypoint.sh volumes: - "./conf/deposit.yml:/deposit.yml:ro" @@ -266,6 +277,7 @@ image: swh/stack build: ./ env_file: + - ./env/common_python.env - ./env/vault-db.env environment: SWH_CONFIG_FILENAME: /vault-api.yml @@ -286,6 +298,8 @@ image: swh/stack build: ./ command: worker + env_file: + - ./env/common_python.env environment: SWH_CONFIG_FILENAME: /cooker.yml depends_on: @@ -311,6 +325,7 @@ image: swh/stack build: ./ env_file: + - ./env/common_python.env - ./env/listers-db.env - ./env/listers.env user: swh @@ -336,6 +351,7 @@ image: swh/stack build: ./ env_file: + - ./env/common_python.env - ./env/listers.env user: swh environment: @@ -359,6 +375,7 @@ build: ./ user: swh env_file: + - ./env/common_python.env - ./env/indexers-db.env - ./env/indexers.env environment: @@ -381,6 +398,8 @@ image: swh/stack build: ./ entrypoint: /entrypoint.sh + env_file: + - ./env/common_python.env depends_on: - kafka - swh-storage diff --git a/docker/env/common_python.env b/docker/env/common_python.env new file mode 100644 --- /dev/null +++ b/docker/env/common_python.env @@ -0,0 +1,5 @@ +# Forces Python's stdout to be shown in docker logs before they exit: +PYTHONUNBUFFERED=1 + +# Uncomment and set this to a Sentry DSN to report errors to Sentry: +# SWH_SENTRY_DSN= diff --git a/docker/services/swh-deposit/entrypoint.sh b/docker/services/swh-deposit/entrypoint.sh --- a/docker/services/swh-deposit/entrypoint.sh +++ b/docker/services/swh-deposit/entrypoint.sh @@ -31,5 +31,6 @@ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ + --config 'python:swh.core.api.gunicorn_config' \ 'django.core.wsgi:get_wsgi_application()' fi diff --git a/docker/services/swh-indexer-storage/entrypoint.sh b/docker/services/swh-indexer-storage/entrypoint.sh --- a/docker/services/swh-indexer-storage/entrypoint.sh +++ b/docker/services/swh-indexer-storage/entrypoint.sh @@ -27,6 +27,7 @@ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ + --config 'python:swh.core.api.gunicorn_config' \ 'swh.indexer.storage.api.server:make_app_from_configfile()' ;; esac diff --git a/docker/services/swh-objstorage/entrypoint.sh b/docker/services/swh-objstorage/entrypoint.sh --- a/docker/services/swh-objstorage/entrypoint.sh +++ b/docker/services/swh-objstorage/entrypoint.sh @@ -19,6 +19,7 @@ --workers 2 \ --reload \ --timeout 3600 \ + --config 'python:swh.core.api.gunicorn_config' \ 'swh.objstorage.api.server:make_app_from_configfile()' fi diff --git a/docker/services/swh-scheduler-api/entrypoint.sh b/docker/services/swh-scheduler-api/entrypoint.sh --- a/docker/services/swh-scheduler-api/entrypoint.sh +++ b/docker/services/swh-scheduler-api/entrypoint.sh @@ -29,6 +29,7 @@ --workers 2 \ --reload \ --timeout 3600 \ + --config 'python:swh.core.api.gunicorn_config' \ 'swh.scheduler.api.server:make_app_from_configfile()' esac diff --git a/docker/services/swh-search/entrypoint.sh b/docker/services/swh-search/entrypoint.sh --- a/docker/services/swh-search/entrypoint.sh +++ b/docker/services/swh-search/entrypoint.sh @@ -26,6 +26,7 @@ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ + --config 'python:swh.core.api.gunicorn_config' \ 'swh.search.api.server:make_app_from_configfile()' ;; esac diff --git a/docker/services/swh-storage-replayer/entrypoint.sh b/docker/services/swh-storage-replayer/entrypoint.sh --- a/docker/services/swh-storage-replayer/entrypoint.sh +++ b/docker/services/swh-storage-replayer/entrypoint.sh @@ -20,7 +20,7 @@ --db-name ${POSTGRES_DB} storage echo Starting the swh-storage Kafka storage replayer - exec swh-journal replay \ + exec swh journal replay \ --broker kafka \ --prefix swh.journal.objects \ --consumer-id swh.storage.replica diff --git a/docker/services/swh-storage/entrypoint.sh b/docker/services/swh-storage/entrypoint.sh --- a/docker/services/swh-storage/entrypoint.sh +++ b/docker/services/swh-storage/entrypoint.sh @@ -40,6 +40,7 @@ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ + --config 'python:swh.core.api.gunicorn_config' \ 'swh.storage.api.server:make_app_from_configfile()' ;; esac diff --git a/docker/services/swh-web/entrypoint.sh b/docker/services/swh-web/entrypoint.sh --- a/docker/services/swh-web/entrypoint.sh +++ b/docker/services/swh-web/entrypoint.sh @@ -34,5 +34,6 @@ --threads 2 \ --workers 2 \ --timeout 3600 \ + --config 'python:swh.web.gunicorn_config' \ 'django.core.wsgi:get_wsgi_application()' esac