Set env files explicitly
This commit is contained in:
parent
ba4b17a8e2
commit
4b04178a4f
3 changed files with 16 additions and 15 deletions
|
|
@ -7,10 +7,9 @@ volumes:
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
env_file: ./.development.env
|
env_file: ./.development.env
|
||||||
|
|
||||||
celery:
|
celery:
|
||||||
env_file: ./.development.env
|
env_file: ./.development.env
|
||||||
environment:
|
|
||||||
- DJANGO_SETTINGS_MODULE=newsreader.conf.docker
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./src/:/app/src
|
- ./src/:/app/src
|
||||||
|
|
||||||
|
|
@ -19,8 +18,6 @@ services:
|
||||||
target: development
|
target: development
|
||||||
command: python /app/src/manage.py runserver 0.0.0.0:8000
|
command: python /app/src/manage.py runserver 0.0.0.0:8000
|
||||||
env_file: ./.development.env
|
env_file: ./.development.env
|
||||||
environment:
|
|
||||||
- DJANGO_SETTINGS_MODULE=newsreader.conf.docker
|
|
||||||
ports:
|
ports:
|
||||||
- "${DJANGO_PORT:-8000}:8000"
|
- "${DJANGO_PORT:-8000}:8000"
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,23 @@ volumes:
|
||||||
static-files:
|
static-files:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
db:
|
||||||
|
env_file: ./.production.env
|
||||||
|
|
||||||
|
celery:
|
||||||
|
env_file: ./.production.env
|
||||||
|
|
||||||
|
django:
|
||||||
|
env_file: ./.production.env
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:1.23
|
image: nginx:1.23
|
||||||
depends_on:
|
depends_on:
|
||||||
django:
|
django:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
env_file: ./.env
|
env_file: ./.production.env
|
||||||
ports:
|
ports:
|
||||||
|
# Note that --env-file should be used to set these correctly
|
||||||
- "${NGINX_HTTP_PORT:-80}:80"
|
- "${NGINX_HTTP_PORT:-80}:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ services:
|
||||||
db:
|
db:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: /usr/bin/pg_isready
|
# Note that --env-file should be used to set these correctly
|
||||||
|
test: /usr/bin/pg_isready --username="${POSTGRES_USER}" --dbname="${POSTGRES_DB}"
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
env_file: ./.env
|
|
||||||
volumes:
|
volumes:
|
||||||
- postgres-data:/var/lib/postgresql/data
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ services:
|
||||||
POSTGRES_USER:
|
POSTGRES_USER:
|
||||||
POSTGRES_PASSWORD:
|
POSTGRES_PASSWORD:
|
||||||
DJANGO_SECRET_KEY:
|
DJANGO_SECRET_KEY:
|
||||||
DJANGO_SETTINGS_MODULE: "newsreader.conf.production"
|
DJANGO_SETTINGS_MODULE:
|
||||||
command: |
|
command: |
|
||||||
celery worker -n worker1@%h
|
celery worker -n worker1@%h
|
||||||
-n worker2@%h
|
-n worker2@%h
|
||||||
|
|
@ -49,9 +49,6 @@ services:
|
||||||
--workdir /app/src/
|
--workdir /app/src/
|
||||||
--beat
|
--beat
|
||||||
--scheduler django
|
--scheduler django
|
||||||
env_file: ./.env
|
|
||||||
environment:
|
|
||||||
- DJANGO_SETTINGS_MODULE=newsreader.conf.production
|
|
||||||
depends_on:
|
depends_on:
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
|
@ -76,7 +73,7 @@ services:
|
||||||
POSTGRES_USER:
|
POSTGRES_USER:
|
||||||
POSTGRES_PASSWORD:
|
POSTGRES_PASSWORD:
|
||||||
DJANGO_SECRET_KEY:
|
DJANGO_SECRET_KEY:
|
||||||
DJANGO_SETTINGS_MODULE: "newsreader.conf.production"
|
DJANGO_SETTINGS_MODULE:
|
||||||
entrypoint: /app/bin/docker-entrypoint.sh
|
entrypoint: /app/bin/docker-entrypoint.sh
|
||||||
command: |
|
command: |
|
||||||
gunicorn --bind 0.0.0.0:8000
|
gunicorn --bind 0.0.0.0:8000
|
||||||
|
|
@ -88,9 +85,6 @@ services:
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
env_file: ./.env
|
|
||||||
environment:
|
|
||||||
- DJANGO_SETTINGS_MODULE=newsreader.conf.production
|
|
||||||
depends_on:
|
depends_on:
|
||||||
memcached:
|
memcached:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue