-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
134 lines (128 loc) · 4.17 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
134 lines (128 loc) · 4.17 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: codefortifyauth
services:
web:
build:
context: .
dockerfile: Dockerfile
container_name: codefortifyauth-web-prod
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000 --workers ${GUNICORN_WORKERS:-3} --timeout ${GUNICORN_TIMEOUT:-120}
env_file:
- .env
environment:
CODEFORTIFY_ENVIRONMENT: production
DEBUG: "False"
ALLOWED_HOSTS: ${ALLOWED_HOSTS}
CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS}
DATABASE_URL: postgresql://${POSTGRES_USER:-codefortifyauth}:${POSTGRES_PASSWORD:-codefortifyauth}@db:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-codefortifyauth}
POSTGRES_HOST: db
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/1}
WAIT_FOR_DB: "true"
RUN_MIGRATIONS: ${RUN_MIGRATIONS:-true}
COLLECT_STATIC: ${COLLECT_STATIC:-true}
volumes:
- static_data:/app/static_root
- media_data:/app/media_root
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "${APP_PORT:-8000}:8000"
restart: unless-stopped
db:
image: postgres:16-alpine
container_name: codefortifyauth-db-prod
env_file:
- .env
environment:
POSTGRES_DB: ${POSTGRES_DB:-codefortifyauth}
POSTGRES_USER: ${POSTGRES_USER:-codefortifyauth}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-codefortifyauth}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-codefortifyauth} -d ${POSTGRES_DB:-codefortifyauth}"]
interval: 10s
timeout: 5s
retries: 20
start_period: 10s
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: codefortifyauth-redis-prod
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 20
start_period: 5s
restart: unless-stopped
celery:
build:
context: .
dockerfile: Dockerfile
container_name: codefortifyauth-celery-prod
command: celery -A core worker -l info
env_file:
- .env
environment:
CODEFORTIFY_ENVIRONMENT: production
DEBUG: "False"
DATABASE_URL: postgresql://${POSTGRES_USER:-codefortifyauth}:${POSTGRES_PASSWORD:-codefortifyauth}@db:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-codefortifyauth}
POSTGRES_HOST: db
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/1}
WAIT_FOR_DB: "true"
RUN_MIGRATIONS: "false"
COLLECT_STATIC: "false"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
celery-beat:
build:
context: .
dockerfile: Dockerfile
container_name: codefortifyauth-celery-beat-prod
command: celery -A core beat -l info --scheduler celery.beat:PersistentScheduler --pidfile=
profiles:
- beat
env_file:
- .env
environment:
CODEFORTIFY_ENVIRONMENT: production
DEBUG: "False"
DATABASE_URL: postgresql://${POSTGRES_USER:-codefortifyauth}:${POSTGRES_PASSWORD:-codefortifyauth}@db:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-codefortifyauth}
POSTGRES_HOST: db
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/1}
WAIT_FOR_DB: "true"
RUN_MIGRATIONS: "false"
COLLECT_STATIC: "false"
volumes:
- celery_beat_data:/app/.celerybeat
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
redis_data:
static_data:
media_data:
celery_beat_data: