-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
201 lines (193 loc) · 4.29 KB
/
docker-compose.yml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
version: '3.8'
services:
backend:
container_name: backend_service
build:
context: ./backend
dockerfile: Dockerfile.backend
ports:
- "5000:5000"
volumes:
- ./backend:/app
- ./nginx/logs:/var/log/nginx
env_file:
- .env
networks:
- xploitcraft_network
deploy:
resources:
limits:
cpus: '4'
memory: '9G'
reservations:
cpus: '2'
memory: '7G'
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
- redis
frontend:
container_name: frontend_service
build:
context: ./frontend/my-react-app
dockerfile: Dockerfile.frontend
env_file:
- .env
ports:
- "3000:3000"
networks:
- xploitcraft_network
deploy:
resources:
limits:
cpus: '2'
memory: '4G'
reservations:
cpus: '1'
memory: '2G'
restart: unless-stopped
redis:
container_name: redis_service
image: redis:latest
ports:
- "6380:6379"
volumes:
- /mnt/storage/redis_data:/data
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: >
redis-server /usr/local/etc/redis/redis.conf
--requirepass ${REDIS_PASSWORD}
--appendonly yes
--protected-mode yes
--bind 0.0.0.0
env_file:
- .env
networks:
- xploitcraft_network
deploy:
resources:
limits:
cpus: '2'
memory: '4G'
reservations:
cpus: '0.5'
memory: '2G'
restart: always
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 30s
timeout: 10s
retries: 3
apache:
container_name: apache_service
build:
context: ./apache
dockerfile: Dockerfile.apache
ports:
- "8080:8080"
networks:
- xploitcraft_network
volumes:
- ./apache/apache_server.conf:/usr/local/apache2/conf/extra/apache_server.conf
- ./apache/httpd.conf:/usr/local/apache2/conf/httpd.conf
deploy:
resources:
limits:
cpus: '2'
memory: '4G'
reservations:
cpus: '1'
memory: '2G'
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
nginx:
container_name: nginx_proxy
image: nginx:latest
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/sites-enabled:/etc/nginx/sites-enabled
- ./nginx/logs:/var/log/nginx/
networks:
- xploitcraft_network
deploy:
resources:
limits:
cpus: '2'
memory: '2G'
reservations:
cpus: '0.5'
memory: '1G'
depends_on:
- apache
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
celery:
container_name: celery_worker
build:
context: ./backend
dockerfile: Dockerfile.backend
command: celery -A helpers.async_tasks worker --loglevel=info --concurrency=8
env_file:
- .env
deploy:
resources:
limits:
cpus: '4'
memory: '6G'
reservations:
cpus: '2'
memory: '3G'
depends_on:
- backend
- redis
networks:
- xploitcraft_network
restart: always
celery_beat:
container_name: celery_beat_service
build:
context: ./backend
dockerfile: Dockerfile.backend
command: celery -A helpers.celery_app beat --loglevel=info
env_file:
- .env
deploy:
resources:
limits:
cpus: '1'
memory: '2G'
reservations:
cpus: '0.5'
memory: '1G'
depends_on:
- backend
- redis
networks:
- xploitcraft_network
volumes:
- ./backend:/app
- ./nginx/logs:/var/log/nginx
restart: always
networks:
xploitcraft_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.28.0.0/16