-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
42 lines (39 loc) · 1.07 KB
/
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
services:
backend:
build: backend
depends_on:
db:
# When started, the Flask app will automatically create the necessary tables in
# MySQL. This will fail if the service is not *healthy* yet. The normal "depends_on"
# clause is not sufficient here, since the container of MySQL can be up but the
# database does not yet accept connections
condition: service_healthy
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MYSQL_DATABASE: flask_db
secrets:
- db_root_password
webserver:
build: webserver
depends_on:
- backend
restart: on-failure
ports:
- 80:80
db:
image: mysql:8.0
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MYSQL_DATABASE: flask_db
ports:
- 3306:3306
secrets:
- db_root_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 10s
retries: 10
secrets:
db_root_password:
file: ./secrets/db_root_password.txt