-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
365 lines (353 loc) · 11.2 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
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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
version: '3.7'
services:
# this init container only recovers users data for flaski3
init:
container_name: init
image: mpgagebioinformatics/flaski:latest
build:
context: ./
dockerfile: Dockerfile
args:
APP_VERSION: dev
PYFLASKI_VERSION: dev
entrypoint: /myapp/services/init/entrypoint.sh
user: root
volumes:
- data3:/myapp_data/users
- ~/myapp:/myapp
- ~/flaski23/backup/stats:/backup/stats
- ~/flaski23/backup/users_data3:/backup/users_data
# - ~/flaski23/backup/users_data2:/backup/users_data
- ~/flaski23/backup/mariadb:/backup/mariadb:ro
- ./_models.py:/myapp/myapp/_models.py
environment:
APP_NAME: myapp
FLASK_ENV: init
ADMINS: [email protected]
RESTORE_DB: 1
RESTORE_USERS_DATA: 1
UPGRADE_DB: 1
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
REDIS_ADDRESS: redis:6379/0
REDIS_PASSWORD: ${REDIS_PASSWORD}
MYSQL_USER: flaski
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_HOST: mariadb
MYSQL_PORT: 3306
DB_NAME: flaski
# MAIL_PORT: 587
# MAIL_USE_TLS: 1
# MAIL_PASSWORD: ${MAIL_PASSWORD}
# MAIL_SERVER: mail.age.mpg.de
MAIL_USERNAME: [email protected]
links:
- mariadb
depends_on:
- mariadb
# server:
# container_name: server
# image: flaski/flaski:latest
# build:
# context: ~/flaski
# dockerfile: services/server/dockerfiles/Dockerfile
# restart: always
# volumes:
# - ~/flaski/utils/dev.py:/flaski/flaski/apps/external.py # this needs to be the first volume as otherwise it will be overwritten by `- ./:/flaski`
# - data:/flaski_data/users
# - ~/flaski:/flaski
# - ~/flaski23/private:/flaski_private:ro
# - ~/flaski23/mpcdf:/mpcdf
# - ~/flaski23/submissions:/submissions
# environment:
# N_WORKERS: 4
# ADMINS: [email protected]
# APP_NAME: flaski
# INSTANCE: backup
# SECRET_KEY: ${SECRET_KEY}
# PRIVATE_APPS: /flaski_private/private.apps.tsv
# APP_URL: https://flaski.localhost
# FLASK_ENV: development #development #production
# LOGS: /var/log/flaski/
# # MAIL_PASSWORD: ${MAIL_PASSWORD}
# # MAIL_PORT: 587
# # MAIL_SERVER: mail.age.mpg.de
# # MAIL_USE_TLS: '1'
# MAIL_USERNAME: [email protected]
# ADMINS: [email protected]
# MYSQL_HOST: mariadb
# MYSQL_PORT: 3306
# MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# MYSQL_USER: flaski
# DB_NAME: flaski
# REDIS_ADDRESS: redis:6379/0
# REDIS_PASSWORD: ${REDIS_PASSWORD}
# labels:
# - traefik.http.services.server.loadbalancer.server.port=8000
# - traefik.http.middlewares.server_https.redirectscheme.scheme=https
# - traefik.http.routers.server.entrypoints=web
# - traefik.http.routers.server.rule=Host(`flaski.localhost`)
# - traefik.http.routers.server.middlewares=server_https@docker
# - traefik.http.routers.server_https.rule=Host(`flaski.localhost`)
# - traefik.http.routers.server_https.tls=true
# - traefik.http.routers.server_https.entrypoints=websecure
# links:
# - mariadb
# - redis
# depends_on:
# - init
# - mariadb
# - redis
server3:
container_name: server3
image: mpgagebioinformatics/flaski:latest
build:
context: ./
dockerfile: Dockerfile
args:
APP_VERSION: dev
PYFLASKI_VERSION: dev
restart: always
volumes:
- ~/flaski23/submissions/:/submissions
- data3:/flaski_data/users
# - ~/tmp_sessions:/flaski_data/users/1
- ~/flaski23/private/:/flaski_private:rw
- ./static/dog-solid.png:/myapp/myapp/static/favicon.ico
- ./static/dog-solid.png:/myapp/myapp/static/logo.png
- ./pyflaski/pyflaski:/myapp/pyflaski
- ./routes/apps:/myapp/myapp/routes/apps
# - ~/myapp/myapp/routes/login.py:/myapp/myapp/routes/login.py
# - ~/myapp/myapp/routes/register.py:/myapp/myapp/routes/register.py
- ~/myapp/myapp/models.py:/myapp/myapp/models.py
- ~/myapp/myapp/routes/_utils.py:/myapp/myapp/routes/_utils.py
- ~/myapp/myapp/routes/admin.py:/myapp/myapp/routes/admin.py
- ./routes/_routes.py:/myapp/myapp/routes/_routes.py
- ./routes/home.py:/myapp/myapp/routes/home.py
- ./routes/index.py:/myapp/myapp/routes/index.py
- ./routes/_impressum.py:/myapp/myapp/routes/_impressum.py
- ./routes/_vars.py:/myapp/myapp/routes/_vars.py
- ./routes/_privacy.py:/myapp/myapp/routes/_privacy.py
- ./routes/_about.py:/myapp/myapp/routes/_about.py
- ~/myapp/myapp/routes/about.py:/myapp/myapp/routes/about.py
- ./email/app_exception.html:/myapp/myapp/templates/email/app_exception.html
- ./email/app_exception.txt:/myapp/myapp/templates/email/app_exception.txt
- ./email/app_help.html:/myapp/myapp/templates/email/app_help.html
- ./email/app_help.txt:/myapp/myapp/templates/email/app_help.txt
- ./email/submissions.age.html:/myapp/myapp/templates/email/submissions.age.html
- ./email/submissions.age.txt:/myapp/myapp/templates/email/submissions.age.txt
- ./email/submissions.mpcdf.html:/myapp/myapp/templates/email/submissions.mpcdf.html
- ./email/submissions.mpcdf.txt:/myapp/myapp/templates/email/submissions.mpcdf.txt
- ./_models.py:/myapp/myapp/_models.py
- ./email/submissions.mpcdf.data.html:/myapp/myapp/templates/email/submissions.mpcdf.data.html
- ./email/submissions.mpcdf.data.txt:/myapp/myapp/templates/email/submissions.mpcdf.data.txt
- ./email/validate_email.html:/myapp/myapp/templates/email/validate_email.html
- ./email/validate_email.txt:/myapp/myapp/templates/email/validate_email.txt
environment:
N_WORKERS: 4
APP_NAME: myapp
APP_TITLE: flaski(local)
INSTANCE: local
SECRET_KEY: ${SECRET_KEY}
APP_URL: https://flaski.localhost/v3
PAGE_PREFIX: /v3
FLASK_ENV: development #development #production
FLASK_DEBUG: 1
# MAIL_PASSWORD: ${MAIL_PASSWORD}
# MAIL_PORT: 587
# MAIL_SERVER: mail.age.mpg.de
MAIL_USERNAME: [email protected]
ADMINS: [email protected]
# MAIL_USE_TLS: '1'
MYSQL_HOST: mariadb
MYSQL_PORT: 3306
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_USER: flaski
DB_NAME: flaski
REDIS_ADDRESS: redis:6379/0
REDIS_PASSWORD: ${REDIS_PASSWORD}
PUREFTPD_AUTH_SALT: ${PUREFTPD_AUTH_SALT}
PUREFTPD_MYSQL_SERVER: ${PUREFTPD_MYSQL_SERVER}
PUREFTPD_MYSQL_PORT: 3306
PUREFTPD_MYSQL_USER: pureftpd
PUREFTPD_MYSQL_PASS: ${PUREFTPD_MYSQL_PASS}
PUREFTPD_MYSQL_DB: pureftpd
labels:
- traefik.http.services.server3.loadbalancer.server.port=8000
- traefik.http.middlewares.server3_https.redirectscheme.scheme=https
- traefik.http.routers.server3.entrypoints=web
- traefik.http.routers.server3.rule=Host(`flaski.localhost`) && PathPrefix(`/v3`)
- traefik.http.routers.server3.middlewares=server3_https@docker
- traefik.http.routers.server3_https.rule=Host(`flaski.localhost`) && PathPrefix(`/v3`)
- traefik.http.routers.server3_https.tls=true
- traefik.http.routers.server3_https.entrypoints=websecure
links:
- mariadb
- redis
depends_on:
- init
- mariadb
- redis
# this backup is currently only backing up the data from v2
backup:
container_name: backup
image: mpgagebioinformatics/myapp:latest
build:
context: ~/myapp
dockerfile: services/server/Dockerfile
args:
BUILD_NAME: myapp
MYAPP_VERSION: dev
UPGRADE_REQS: "no"
entrypoint: /flaski/services/backup/entrypoint.sh
user: root
depends_on:
- mariadb
- init
volumes:
- ~/myapp:/flaski
- ~/flaski23/backup/stats:/backup/stats
- ~/flaski23/backup/users_data:/backup/users_data
- ~/flaski23/backup/mariadb:/backup/mariadb:ro
- data3:/myapp_data/users:ro
environment:
APP_NAME: flaski
INSTANCE: backup
FLASK_ENV: backup
LOGS: /var/log/flaski/
MYSQL_HOST: mariadb
MYSQL_PORT: 3306
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_USER: flaski
DB_NAME: flaski
restart: unless-stopped
links:
- mariadb
# this backup is currently only backing up the data from v2
# backup:
# container_name: backup
# image: mpgagebioinformatics/myapp-flaski2:latest
# build:
# context: ~/myapp
# dockerfile: services/server/Dockerfile
# args:
# BUILD_NAME: flaski
# MYAPP_VERSION: dev
# UPGRADE_REQS: "no"
# entrypoint: /flaski/services/backup/entrypoint.sh
# user: root
# depends_on:
# - mariadb
# - init
# volumes:
# - ~/myapp:/flaski
# - ~/flaski23/backup/stats:/backup/stats
# - ~/flaski23/backup/users_data:/backup/users_data
# - ~/flaski23/backup/mariadb:/backup/mariadb:ro
# - data:/flaski_data/users:ro
# environment:
# APP_NAME: flaski
# INSTANCE: backup
# FLASK_ENV: backup
# LOGS: /var/log/flaski/
# MYSQL_HOST: mariadb
# MYSQL_PORT: 3306
# MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# MYSQL_USER: flaski
# DB_NAME: flaski
# restart: unless-stopped
# links:
# - mariadb
# uploads:
# container_name: uploads
# # image: mpgagebioinformatics/myapp:latest # -flaski2:latest
# build:
# context: ~/myapp
# dockerfile: services/server/Dockerfile
# args:
# BUILD_NAME: myapp
# MYAPP_VERSION: dev
# UPGRADE_REQS: "no"
# entrypoint: /myapp/services/rsync/entrypoint.sh
# volumes:
# - ~/myapp:/myapp
# - ~/flaski23/backup/mpcdf/:/mpcdf
# - ~/flaski23/backup/submissions/:/submissions
# - ./.owncloud.flaski:/flaski/.owncloud.flaski
# # - /srv/submissions/:/submissions
# # - /srv/backup/mariadb:/backup/mariadb
# # - /srv/backup/data/users:/backup/users_data
# environment:
# FLASK_ENV: rsync
# OWNCLOUD_ADDRESS: https://datashare.mpcdf.mpg.de
# OWNCLOUD_USER: g-flaski
# OWNCLOUD_PASS: ${OWNCLOUD_PASS}
# restart: unless-stopped
mariadb:
container_name: mariadb
image: mariadb:10.5
restart: always
volumes:
- db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
redis:
container_name: redis
image: redis:7
restart: always
command: redis-server --requirepass ${REDIS_PASSWORD}
reverse-proxy:
image: traefik:v2.6
command:
- --api.insecure=true
- --providers.docker=true
- --entrypoints.websecure.address=:443
- --entrypoints.web.address=:80
# - --providers.file.filename=/etc/traefik/dynamic_conf/conf.yml
# - --providers.file.watch=true
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
# - ~/flaski23/certificates/:/tools/certs
# - ./services/traefik/config.yml:/etc/traefik/dynamic_conf/conf.yml:ro
- /var/run/docker.sock:/var/run/docker.sock
labels:
- traefik.enable=false
depends_on:
# - server
- server3
# nginx:
# container_name: nginx
# image: nginx:alpine
# restart: always
# ports:
# - 80:80
# - 443:443
# volumes:
# # prod
# # - ./services/nginx/flaski23.conf:/etc/nginx/conf.d/default.conf:rw
# # - ~/flaski23/certificates/cert.pem:/certs/cert.pem:ro
# # - ~/flaski23/certificates/key.pem:/certs/key.pem:ro
# # - ~/flaski23/certificates/dhparam.pem:/certs/dhparam.pem:ro
# # dev
# - ./services/nginx/dev.conf:/etc/nginx/conf.d/default.conf:rw
# - ~/flaski23/certificates/selfsigned/cert.pem:/certs/cert.pem:ro
# - ~/flaski23/certificates/selfsigned/key.pem:/certs/key.pem:ro
# - ~/flaski23/certificates/dhparam.pem:/certs/dhparam.pem:ro
# links:
# - server
# - server3
# depends_on:
# - server
# - server3
volumes:
# data:
# external: false
data3:
external: false
db:
external: false
oc:
external: false