-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.https.yml
More file actions
95 lines (89 loc) · 2.25 KB
/
Copy pathdocker-compose.prod.https.yml
File metadata and controls
95 lines (89 loc) · 2.25 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
services:
reverse-proxy:
image: nginx:1.27-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./infra/nginx/default.ssl.conf:/etc/nginx/conf.d/default.conf:ro
- ./infra/certs:/etc/nginx/certs:ro
depends_on:
frontend:
condition: service_started
backend:
condition: service_started
restart: unless-stopped
frontend:
build:
context: .
dockerfile: frontend.prod.Dockerfile
env_file:
- .env
environment:
NODE_ENV: production
BACKEND_API_URL: /api
BACKEND_INTERNAL_API_URL: http://backend:8000/api
depends_on:
backend:
condition: service_started
restart: unless-stopped
backend:
build:
context: .
dockerfile: backend/Dockerfile
command: >
sh -c "
alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000
"
env_file:
- .env
environment:
APP_ENV: production
DEBUG: "false"
API_DOCS_ENABLED: "false"
ALLOW_ORIGINLESS_UNSAFE_REQUESTS: "false"
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_DB}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 12
start_period: 5s
restart: unless-stopped
scheduler:
build:
context: .
dockerfile: backend/Dockerfile
command: python -m app.tasks.scheduler
env_file:
- .env
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_SERVER}:${POSTGRES_PORT}/${POSTGRES_DB}
volumes:
- ./backend:/app
depends_on:
postgres:
condition: service_healthy
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
restart: unless-stopped
volumes:
postgres_data:
redis_data: