-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
113 lines (111 loc) · 2.75 KB
/
docker-compose.yaml
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
version: "3.9"
# Shared environment variable configuration between the app service profiles
x-env: &env
ST_SECRET_KEY:
ST_DATABASE_URI: "mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql/${MYSQL_DATABASE}"
MINIO_ENDPOINT: minio:9000
MINIO_ACCESS_KEY:
MINIO_SECRET_KEY:
MINIO_REGION_NAME:
SLURM_ENDPOINT:
SLURM_USER:
SLURM_JWT:
services:
mysql:
image: mysql:8.0
restart: on-failure
environment:
TZ: America/Toronto
MYSQL_DATABASE:
MYSQL_USER:
MYSQL_PASSWORD:
MYSQL_ROOT_PASSWORD:
ports:
- "${MYSQL_HOST_PORT:-127.0.0.1:3306}:3306"
volumes:
- ${MYSQL_VOLUME}:/var/lib/mysql
minio:
image: minio/minio:RELEASE.2022-06-20T23-13-45Z
restart: on-failure
environment:
TZ: America/Toronto
MINIO_ROOT_USER: "${MINIO_ACCESS_KEY}"
MINIO_ROOT_PASSWORD: "${MINIO_SECRET_KEY}"
MINIO_REGION_NAME:
MINIO_UPDATE: "off"
ports:
- "${MINIO_HOST_PORT:-127.0.0.1:9000}:9000"
- "${CONSOLE_HOST_PORT:-127.0.0.1:9090}:9090"
volumes:
- ${MINIO_VOLUME}:/data
command: server /data --console-address ":9090"
app:
build: flask
image: ghcr.io/ccmbioinfo/stager:dev
environment:
<<: *env
ports:
- "${FLASK_HOST_PORT:-127.0.0.1:5000}:5000"
depends_on:
- mysql
- minio
volumes:
- ./flask:/usr/src/stager
app_debug:
build: flask
image: ghcr.io/ccmbioinfo/stager:dev
profiles:
- debug
environment:
<<: *env
FLASK_DEBUG: 1
PYTHONDONTWRITEBYTECODE: 1
DEBUG_METRICS: 1
ports:
- "${FLASK_HOST_PORT:-127.0.0.1:5000}:5000"
- "${DEBUG_HOST_PORT:-127.0.0.1:5678}:5678"
depends_on:
- mysql
- minio
volumes:
- ./flask:/usr/src/stager
entrypoint: ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "-m", "flask", "run", "--host=0.0.0.0"]
# Simulated production gunicorn configuration
app_gunicorn:
build:
context: flask
dockerfile: ../Dockerfile
args:
GIT_SHA:
image: ghcr.io/ccmbioinfo/stager:latest
user: www-data
profiles:
- gunicorn
environment:
<<: *env
SQLALCHEMY_SIDECAR: /var/tmp/sqlalchemy.fifo
tmpfs:
- /tmp
volumes:
- log-fifo:/var/tmp
ports:
- "${FLASK_HOST_PORT:-127.0.0.1:5000}:5000"
- "${METRICS_HOST_PORT:-127.0.0.1:8080}:8080"
depends_on:
- mysql
- minio
# See __init__.py::config_logger for an explainer
sidecar-sqlalchemy:
image: busybox
user: www-data
profiles:
- gunicorn
init: true
command: tail -f -n +1 /var/log/stager/sqlalchemy.fifo
volumes:
- log-fifo:/var/log/stager:ro
depends_on:
- app_gunicorn
restart: unless-stopped
volumes:
log-fifo: