-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathproduction-compose.yml
200 lines (191 loc) · 5.36 KB
/
production-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
version: '3.7'
services:
init:
container_name: init
image: mpgagebioinformatics/flaski:latest
# build:
# context: ~/myapp
# dockerfile: services/server/Dockerfile
# args:
# BUILD_NAME: myapp
# MYAPP_VERSION: dev
# UPGRADE_REQS: "no"
entrypoint: /myapp/services/init/entrypoint.sh
user: root
volumes:
- data3:/myapp_data/users
- private:/flaski_private
- mysql-certs:/etc/mysql/certs
- ~/backups:/backup
environment:
APP_NAME: myapp
FLASK_ENV: init
APP_URL: https://flaski.age.mpg.de
ADMINS: [email protected]
RESTORE_DB: 0
RESTORE_USERS_DATA: 0
UPGRADE_DB: 0
RESTORE_CERTS: 0
RESTORE_DATALAKE: 0
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
links:
- mariadb
depends_on:
- mariadb
server3:
container_name: server3
image: mpgagebioinformatics/flaski:stable
# build:
# context: ./
# dockerfile: Dockerfile
# args:
# APP_VERSION: dev
# PYFLASKI_VERSION: dev
restart: always
volumes:
- data3:/flaski_data/users
- private:/flaski_private
- mysql-certs:/etc/mysql/certs
- ~/mpcdf:/mpcdf
environment:
N_WORKERS: 4
APP_NAME: myapp
APP_TITLE: flaski
# INSTANCE: local
SECRET_KEY: ${SECRET_KEY}
APP_URL: https://flaski.age.mpg.de
PAGE_PREFIX: ""
FLASK_ENV: production
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.enable=true
- traefik.http.services.server3.loadbalancer.server.port=8000
- traefik.http.routers.server3.entrypoints=web
- traefik.http.routers.server3.rule=Host(`flaski.age.mpg.de`)
- traefik.http.middlewares.server3.redirectscheme.scheme=https
- traefik.http.routers.server3.middlewares=server3@docker
- traefik.http.routers.server3_https.entrypoints=websecure
- traefik.http.routers.server3_https.rule=Host(`flaski.age.mpg.de`)
- traefik.http.routers.server3_https.tls=true
- traefik.http.routers.server3_https.tls.certresolver=myresolver
links:
- mariadb
- redis
depends_on:
- init
- mariadb
- redis
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: /myapp/services/backup/entrypoint.sh
user: root
depends_on:
- mariadb
- init
volumes:
- data3:/myapp_data/users:ro
- ~/backups:/backup
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
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.9"
restart: always
container_name: "traefik"
command:
- --providers.docker=true
- --providers.docker.useBindPortIP=true
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- --certificatesresolvers.myresolver.acme.httpchallenge=true
- --certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web
- --certificatesresolvers.myresolver.acme.tlschallenge=true
#- --certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
#- --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme-dev-4.json
- --certificatesresolvers.myresolver.acme.caserver=https://acme-v02.api.letsencrypt.org/directory
- --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme-prod-3.json
- --log.level=DEBUG
ports:
- 80:80
- 443:443
volumes:
- ~/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- traefik.enable=true
# Global redir to https
- traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
- traefik.http.routers.http-catchall.entrypoints=web
- traefik.http.routers.http-catchall.middlewares=redirect-to-https
- traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
depends_on:
- server3
volumes:
data3:
external: false
db:
external: false
private:
external: false
mysql-certs:
external: false