-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose-laboutik-V1.yml
More file actions
336 lines (307 loc) · 9.54 KB
/
Copy pathdocker-compose-laboutik-V1.yml
File metadata and controls
336 lines (307 loc) · 9.54 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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
####
# DEV ENV MONO REPO
####
services:
#########
# TRAEFIK PROXY
#########
traefik:
image: "traefik:latest"
container_name: "traefik"
hostname: "traefik"
command:
- "--log.level=INFO"
- "--providers.docker=true"
- "--providers.docker.network=frontend"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.entrypoints-https.address=:443"
- "--entrypoints.entrypoints-http.address=:80"
- "--entrypoints.entrypoints-http.http.redirections.entryPoint.to=entrypoints-https"
- "--entrypoints.entrypoints-http.http.redirections.entryPoint.scheme=https"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
restart: unless-stopped
networks:
- frontend
#### FEDOW ####
fedow_memcached:
image: memcached:1.6
container_name: fedow_memcached
hostname: fedow_memcached
restart: always
networks:
- backend
fedow_django:
image: tibillet/fedow:latest
container_name: fedow_django
hostname: fedow_django
restart: unless-stopped
env_file: .env
user: fedow
links:
- fedow_memcached:memcached
environment:
# Override DOMAIN pour LaBoutik : sous-domaine du service, pas le wildcard tenant.
# Resolu par compose via le .env (DOMAIN=tibillet.localhost) -> laboutik.tibillet.localhost.
DOMAIN: fedow.$DOMAIN
volumes:
# Bind-mount du code source Fedow pour le dev (comme ../LaBoutik cote Laboutik).
- ../Fedow:/home/fedow/Fedow
# Le volume nomme reste en sous-montage : la base SQLite est preservee.
- fedow_database:/home/fedow/Fedow/database
# - ../Fedow/database:/home/fedow/Fedow/database
networks:
- backend
command: "bash start.sh"
# command: "bash start_dev.sh"
extra_hosts:
- fedow.tibillet.localhost:172.17.0.1
- lespass.tibillet.localhost:172.17.0.1
- laboutik.tibillet.localhost:172.17.0.1
- laboutik2.tibillet.localhost:172.17.0.1
fedow_nginx:
image: nginx
restart: unless-stopped
container_name: fedow_nginx
hostname: fedow_nginx
volumes:
- ./nginx/fedow_nginx.conf:/etc/nginx/conf.d/default.conf:ro
# Statics partages avec django : collectstatic ecrit dans ../Fedow/www/static,
# nginx les sert via "root /www" (cf. fedow_nginx.conf). Meme motif que Lespass/Laboutik.
# / Statics shared with django: collectstatic writes to ../Fedow/www/static,
# nginx serves them via "root /www" (see fedow_nginx.conf). Same pattern as Lespass/Laboutik.
- ../Fedow/www:/www
- ./logs:/logs
depends_on:
- fedow_django
links:
- fedow_django:fedow_django
labels:
- traefik.enable=true
- traefik.docker.network=frontend
- traefik.http.routers.fedow_nginx.tls=true
- traefik.http.routers.fedow_nginx.rule=Host(`fedow.$DOMAIN`)
- traefik.http.services.fedow_nginx.loadbalancer.server.port=80
- traefik.http.routers.fedow_nginx.priority=100 # plus c'est grand, plus c'est prioritaire
networks:
- frontend
- backend
#########
# TIBILLET MONOREPO
#########
lespass_postgres:
image: postgres:13-bookworm
restart: unless-stopped
container_name: lespass_postgres
hostname: lespass_postgres
volumes:
- lespass_dev_db:/var/lib/postgresql/data
env_file: .env
networks:
- backend
lespass_memcached:
image : memcached:1.6
container_name: lespass_memcached
hostname: lespass_memcached
restart: unless-stopped
networks:
- backend
lespass_redis:
container_name: lespass_redis
hostname: lespass_redis
image: redis:7.2.3-bookworm
restart: unless-stopped
networks:
- backend
lespass_django:
image: tibillet/lespass:latest
restart: unless-stopped
container_name: lespass_django
hostname: lespass_django
volumes:
- ./:/DjangoFiles
env_file: .env
depends_on:
- lespass_postgres
- lespass_redis
- lespass_memcached
links:
- lespass_postgres:postgres
- lespass_redis:redis
- lespass_memcached:memcached
networks:
- backend
extra_hosts:
- fedow.tibillet.localhost:172.17.0.1
- lespass.tibillet.localhost:172.17.0.1
- laboutik.tibillet.localhost:172.17.0.1
- laboutik2.tibillet.localhost:172.17.0.1
command: 'bash start_dev.sh'
lespass_celery:
image: tibillet/lespass:latest
container_name: lespass_celery
restart: unless-stopped
hostname: lespass_celery
env_file: .env
volumes:
- ./:/DjangoFiles
depends_on:
- lespass_postgres
- lespass_redis
- lespass_memcached
links:
- lespass_postgres:postgres
- lespass_redis:redis
- lespass_memcached:memcached
networks:
- backend
extra_hosts:
- fedow.tibillet.localhost:172.17.0.1
- lespass.tibillet.localhost:172.17.0.1
- laboutik.tibillet.localhost:172.17.0.1
- laboutik2.tibillet.localhost:172.17.0.1
command: "poetry run celery -A TiBillet worker -l INFO -B --concurrency=6"
lespass_nginx:
image: nginx:latest
container_name: lespass_nginx
restart: unless-stopped
hostname: lespass_nginx
links:
- lespass_django:lespass_django
volumes:
- ./nginx/lespass_dev.conf:/etc/nginx/conf.d/default.conf:ro
- ./www:/www
- ./logs:/logs
labels:
- traefik.enable=true
- traefik.docker.network=frontend
- traefik.http.routers.lespass_nginx.tls=true
- traefik.http.routers.lespass_nginx.rule=Host(`$DOMAIN`) || Host(`lespass.$DOMAIN`)
- traefik.http.services.lespass_nginx.loadbalancer.server.port=80
- traefik.http.routers.lespass_nginx.priority=1 # plus c'est grand, plus c'est prioritaire
networks:
- backend
- frontend
#### CASHLESS 1 ####
laboutik_postgres:
image: postgres:11.5-alpine
restart: always
env_file: .env
container_name: laboutik_postgres
hostname: laboutik_postgres
volumes:
- laboutik_postgres_data:/var/lib/postgresql/data
networks:
- backend
laboutik_memcached:
image: memcached:1.6
container_name: laboutik_memcached
hostname: laboutik_memcached
restart: always
networks:
- backend
laboutik_redis:
image: redis:6-alpine
restart: always
env_file: .env
container_name: laboutik_redis
hostname: laboutik_redis
networks:
- backend
laboutik_django:
image: tibillet/laboutik:latest
restart: always
env_file: .env
container_name: laboutik_django
hostname: laboutik_django
volumes:
- ../LaBoutik:/DjangoFiles
links:
- laboutik_postgres:postgres
- laboutik_redis:redis
- laboutik_memcached:memcached
depends_on:
- laboutik_postgres
- laboutik_redis
- laboutik_memcached
environment:
# Override DOMAIN pour LaBoutik : sous-domaine du service, pas le wildcard tenant.
# Resolu par compose via le .env (DOMAIN=tibillet.localhost) -> laboutik.tibillet.localhost.
DOMAIN: laboutik.$DOMAIN
command: 'bash start_dev.sh'
extra_hosts:
- fedow.tibillet.localhost:172.17.0.1
- lespass.tibillet.localhost:172.17.0.1
- laboutik.tibillet.localhost:172.17.0.1
- laboutik2.tibillet.localhost:172.17.0.1
networks:
- backend
laboutik_celery:
image: tibillet/laboutik:latest
restart: always
env_file: .env
container_name: laboutik_celery
hostname: laboutik_celery
environment:
# Override DOMAIN pour LaBoutik : sous-domaine du service, pas le wildcard tenant.
# Resolu par compose via le .env (DOMAIN=tibillet.localhost) -> laboutik.tibillet.localhost.
DOMAIN: laboutik.$DOMAIN
volumes:
- ../LaBoutik:/DjangoFiles
links:
- laboutik_postgres:postgres
- laboutik_redis:redis
- laboutik_memcached:memcached
depends_on:
- laboutik_postgres
- laboutik_django
- laboutik_memcached
command: "bash start_celery.sh"
extra_hosts:
- fedow.tibillet.localhost:172.17.0.1
- lespass.tibillet.localhost:172.17.0.1
- laboutik.tibillet.localhost:172.17.0.1
- laboutik2.tibillet.localhost:172.17.0.1
networks:
- backend
laboutik_nginx:
image: nginx
restart: always
container_name: laboutik_nginx
hostname: laboutik_nginx
depends_on:
- laboutik_django
links:
- laboutik_django:laboutik_django
volumes:
- ../LaBoutik/www:/DjangoFiles/www
- ../LaBoutik/logs:/DjangoFiles/logs
- ../LaBoutik/nginx:/etc/nginx/conf.d
labels:
- traefik.enable=true
- traefik.docker.network=frontend
- traefik.http.routers.laboutik_nginx.tls.certresolver=myresolver
- traefik.http.routers.laboutik_nginx.rule=Host(`laboutik.$DOMAIN`)
- traefik.http.routers.laboutik_nginx.priority=100 # plus c'est grand, plus c'est prioritaire
networks:
- frontend
- backend
networks:
frontend:
external: true
backend:
volumes:
lespass_dev_db:
fedow_database:
fedow_dev_db:
laboutik_postgres_data:
# Pour test stripe :
# stripe listen --forward-to https://fedow.tibillet.localhost/api/webhook_stripe/ --skip-verify
# stripe listen --forward-to https://tibillet.localhost/api/webhook_stripe/ --skip-verify
# poetry shell
# django-admin makemessages -l fr && django-admin makemessages -l en
# django-admin compilemessages
# docker build -t lespass . && docker tag lespass tibillet/lespass:latest && docker tag lespass tibillet/lespass:0.10.5 && docker push tibillet/lespass:latest && docker push tibillet/lespass:0.10.5