-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
69 lines (65 loc) · 1.57 KB
/
docker-compose.prod.yml
File metadata and controls
69 lines (65 loc) · 1.57 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
version: '3.8'
services:
db:
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- db_data:/var/lib/postgresql/data
- ./backups:/backups
expose:
- "5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile.prod
restart: always
env_file:
- ./.env
environment:
- DATABASE_URL=${DATABASE_URL}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- SECRET_KEY=${SECRET_KEY}
- BASE_URL=${BACKEND_URL}
- FRONTEND_URL=${FRONTEND_URL}
expose:
- "${BACKEND_PORT}"
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
depends_on:
db:
condition: service_healthy
command: ["gunicorn", "app.main:app", "-c", "gunicorn.conf.py"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_PORT}/api/health"]
interval: 30s
timeout: 10s
retries: 3
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
args:
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
restart: always
env_file:
- ./.env
environment:
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
expose:
- "${FRONTEND_PORT}"
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
depends_on:
- backend
volumes:
db_data: