-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose-prod.yml
87 lines (87 loc) · 2.59 KB
/
docker-compose-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3.9'
services:
testy:
container_name: testy
extra_hosts:
- "host.docker.internal:host-gateway"
build:
context: testy
dockerfile: scripts/prod/Dockerfile
volumes:
- './:/testy'
ports:
- "8001:8000"
environment:
- DJANGO_SETTINGS_MODULE=testy.settings.production
- POSTGRES_NAME=${POSTGRES_NAME}
- POSTGRES_USER=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_SERVICE_HOST=${POSTGRES_SERVICE_HOST}
- POSTGRES_SERVICE_PORT=${POSTGRES_SERVICE_PORT}
- COMPANY_DOMAIN=${COMPANY_DOMAIN}
- SUPERUSER_USERNAME=${SUPERUSER_USERNAME}
- SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- SECRET_KEY=${SECRET_KEY}
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
depends_on:
db:
condition: service_healthy
db:
container_name: testy_db
image: postgres:14.5-alpine
volumes:
- ./pg-data:/var/lib/postgresql/data
ports:
- "5435:5432"
environment:
- POSTGRES_USER=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_NAME}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
redis:
container_name: testy_redis
image: redis:alpine
command: redis-server --appendonly yes
volumes:
- "./redis_data:/data"
ports:
- "6380:6379"
celery:
container_name: testy_celery
extra_hosts:
- "host.docker.internal:host-gateway"
restart: always
build:
context: testy
dockerfile: scripts/prod/celery/Dockerfile
command: celery -A testy worker -l INFO
environment:
- DJANGO_SETTINGS_MODULE=testy.settings.production
- POSTGRES_NAME=${POSTGRES_NAME}
- POSTGRES_USER=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_SERVICE_HOST=${POSTGRES_SERVICE_HOST}
- POSTGRES_SERVICE_PORT=${POSTGRES_SERVICE_PORT}
- COMPANY_DOMAIN=${COMPANY_DOMAIN}
- SUPERUSER_USERNAME=${SUPERUSER_USERNAME}
- SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- SECRET_KEY=${SECRET_KEY}
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
volumes:
- './testy:/testy'
depends_on:
- testy
- db
- redis