This repository was archived by the owner on Nov 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
279 lines (254 loc) · 6.23 KB
/
docker-compose.yml
File metadata and controls
279 lines (254 loc) · 6.23 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
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
##################################################################
# Déclarations communes #
##################################################################
x-common-env: &common_env
- ./secret/.env
x-common-networks: &common_networks
- backend_network
- frontend_network
x-redis-env: &redis_env
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_PASS: ${REDIS_PASS}
x-build-defaults: &build_defaults
context: .
x-depends-base: &depends_base
base:
condition: service_started
x-service-defaults: &service_defaults
env_file: *common_env
networks: *common_networks
depends_on:
<<: *depends_base
volumes:
- certif_data:/data/certs
##################################################################
# Définition des services #
##################################################################
services:
certif-issuer:
build:
context: .
dockerfile: backend/certif-issuer/Dockerfile
container_name: certif_issuer
networks:
- backend_network
secrets:
- hostname
volumes:
- certif_data:/data/certs
base:
build:
context: .
dockerfile: base.Dockerfile
container_name: base_image
image: myapp-base
networks:
- backend_network
secrets:
- hostname
- django_secret
depends_on:
certif-issuer:
condition: service_started
redis:
condition: service_started
postgres:
condition: service_healthy
postgres:
build:
context: ./database
container_name: postgres_db
env_file: *common_env
volumes:
- postgres_data_volume:/var/lib/postgresql/data
networks:
- backend_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
redis:
build:
context: ./backend/redis/
container_name: redis
networks:
- backend_network
volumes:
- redis_data:/data
ports:
- "6380:6379"
env_file: *common_env
gateway-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/gateway-service/Dockerfile
container_name: gateway_service
ports:
- "3006:3006"
secrets:
- hostname
- django_secret
auth-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/auth-service/Dockerfile
container_name: auth_service
secrets:
- oauth_hostname
- fernet_key
- smtp_host_user
- smtp_host_password
- twilio_account_sid
- twilio_auth_token
- twilio_phone_number
- 42_uid
- 42_secret
- hostname
- jwt_secret
- django_secret
ports:
- "3001:3001"
user-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/user-service/Dockerfile
container_name: user_service
secrets:
- hostname
- fernet_key
- jwt_secret
- django_secret
ports:
- "3002:3002"
volumes:
- certif_data:/data/certs
- media_volume:/app/media:rw
livechat-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/livechat-service/Dockerfile
container_name: livechat_service
environment:
<<: [ *redis_env ]
ports:
- "3003:3003"
secrets:
- hostname
- django_secret
pong-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/pong-service/Dockerfile
container_name: pong_service
environment:
<<: [ *redis_env ]
ports:
- "3004:3004"
secrets:
- hostname
- django_secret
matchmaking-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/matchmaking-service/Dockerfile
container_name: matchmaking_service
ports:
- "3005:3005"
secrets:
- hostname
- django_secret
tournament-service:
<<: *service_defaults
build:
<<: *build_defaults
dockerfile: backend/tournament-service/Dockerfile
container_name: tournament_service
secrets:
- hostname
- fernet_key
- jwt_secret
- django_secret
ports:
- "3007:3007"
nginx:
build:
context: ./nginx
container_name: nginx_proxy
restart: always
volumes:
- certif_data:/etc/nginx/certs:rw
- ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template:ro
- ./frontend:/usr/share/nginx/html/frontend:ro
- media_volume:/app/media:rw
depends_on:
gateway-service:
condition: service_started
auth-service:
condition: service_started
user-service:
condition: service_started
livechat-service:
condition: service_started
pong-service:
condition: service_started
matchmaking-service:
condition: service_started
tournament-service:
condition: service_started
ports:
- "8443:443"
networks:
- frontend_network
- backend_network
secrets:
- hostname
##################################################################
# Réseaux et volumes et secrets #
##################################################################
networks:
backend_network:
name: backend_network
frontend_network:
name: frontend_network
volumes:
postgres_data_volume:
name: postgres_data_volume
redis_data:
name: redis_data
certif_data:
name: certif_data_volume
media_volume:
driver: local
secrets:
django_secret:
file: ./secret/django_secret.txt
fernet_key:
file: ./secret/fernet_key.txt
smtp_host_user:
file: ./secret/smtp_host_user.txt
smtp_host_password:
file: ./secret/smtp_host_password.txt
twilio_account_sid:
file: ./secret/twilio_account_sid.txt
twilio_auth_token:
file: ./secret/twilio_auth_token.txt
twilio_phone_number:
file: ./secret/twilio_phone_number.txt
42_secret:
file: ./secret/42_secret.txt
42_uid:
file: ./secret/42_uid.txt
hostname:
file: ./secret/hostname.txt
jwt_secret:
file: ./secret/jwt_secret.txt
oauth_hostname:
file: ./secret/oauth_hostname.txt