-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (87 loc) · 2.07 KB
/
Copy pathdocker-compose.yml
File metadata and controls
95 lines (87 loc) · 2.07 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:
## === ------- Backend Instance [1] -------- ===
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: disney-backend-1
environment:
- PYTHONUNBUFFERED=1
- ENVIRONMENT=development
- INSTANCE_ID=backend_1
volumes:
- ./backend/data:/app/data:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
expose:
- "5000"
networks:
- disney-networks
restart: unless-stopped
## === ------ Backend instance [2] (load balancer) -------
backend_2:
build:
context: ./backend
dockerfile: Dockerfile
container_name: disney-backend-2
environment:
- PYTHONUNBUFFERED=1
- ENVIRONMENT=development
- INSTANCE_ID=backend_2
volumes:
- ./backend/data:/app/data:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
expose:
- "5000"
networks:
- disney-networks
restart: unless-stopped
## === ------ Frontend -------
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: /api/v1
VITE_ENVIRONMENT: production
container_name: disney-frontend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- disney-networks
restart: unless-stopped
depends_on:
- backend
## === ------ Nginx - Reverse Proxy + Load Balancer -------
nginx:
image: nginx:alpine
container_name: disney-nginx
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
backend:
condition: service_healthy
backend_2:
condition: service_healthy
frontend:
condition: service_started
networks:
- disney-networks
restart: unless-stopped
networks:
disney-networks:
driver: bridge