-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (78 loc) · 1.67 KB
/
docker-compose.yml
File metadata and controls
83 lines (78 loc) · 1.67 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
version: '3.8'
services:
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
container_name: nginx
ports:
- "443:443"
healthcheck:
test: ["CMD-SHELL", "curl -f https://localhost/api/health-check || exit 1"]
interval: 30s
timeout: 10s
retries: 3
depends_on:
- backend
networks:
- app-network
env_file:
- frontend/.env
volumes:
- media_data:/media
backend:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- frontend/.env
container_name: backend
environment:
- DJANGO_SETTINGS_MODULE=main.settings
depends_on:
db:
condition: service_healthy
networks:
- app-network
volumes:
- media_data:/app/media
db:
image: postgres:15
container_name: postgres
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NODE_ENV: production
env_file:
- frontend/.env
container_name: frontend
depends_on:
- backend
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
media_data:
networks:
app-network:
driver: bridge