-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
112 lines (104 loc) · 3.44 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
services:
moeflow-mongodb:
image: ${DH_DOMAIN}/mongo:4.4.1
restart: unless-stopped
volumes:
- ./mongodb/data/db:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASS}
command: ['--quiet', '--setParameter', 'logLevel=0']
networks:
- default
healthcheck:
# test: ["CMD","mongo", "--eval", "db.adminCommand('ping')"]
test: ["CMD","bash", '-c', "exec 9<> /dev/tcp/127.0.0.1/27017"]
interval: 15s
timeout: 5s
start_period: 10s
moeflow-rabbitmq:
image: ${DH_DOMAIN}/rabbitmq:3.8.9-management
restart: unless-stopped
volumes:
- ./rabbitmq:/var/lib/rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS}
RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_VHOST_NAME}
networks:
- default
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 5s
timeout: 5s
start_period: 10s
moeflow-backend: &backend_base
image: ${GHCR_DOMAIN}/${MOEFLOW_BACKEND_IMAGE}:${MOEFLOW_BACKEND_VERSION}
command: gunicorn -t 120 -w 4 -b 0.0.0.0:5000 "app:create_app()"
volumes:
- ./storage:/app/storage
- ./logs/moeflow-backend:/app/logs
env_file:
- .env-backend
environment:
# forward envs set in .env
STORAGE_DOMAIN: https://${DOMAIN}/storage/
MONGODB_URI: mongodb://${MONGODB_USER}:${MONGODB_PASS}@moeflow-mongodb:27017/moeflow?authSource=admin
CELERY_BROKER_URL: amqp://${RABBITMQ_USER}:${RABBITMQ_PASS}@moeflow-rabbitmq:5672/${RABBITMQ_VHOST_NAME}
MAX_CONTENT_LENGTH_MB: ${MAX_CONTENT_LENGTH_MB}
networks:
- default
restart: unless-stopped
depends_on:
moeflow-backend-init:
condition: service_completed_successfully
moeflow-backend-init:
<<: *backend_base
command: python3 manage.py migrate
restart: 'no'
depends_on: &backend-deps
moeflow-rabbitmq:
condition: service_healthy
moeflow-mongodb:
condition: service_healthy
moeflow-celery-default:
<<: *backend_base
command: celery --app app.celery worker --queues default --hostname celery.default --loglevel=info
moeflow-celery-output:
<<: *backend_base
command: celery --app app.celery worker --queues output --hostname celery.output --loglevel=info
moeflow-celery-mit:
image: ${GHCR_DOMAIN}/${MOEFLOW_MIT_WORKER_IMAGE:-UNSET}:${MOEFLOW_MIT_WORKER_VERSION:-UNSET}
restart: unless-stopped
volumes:
- ./storage:/app/storage
env_file:
- '.env-mit-worker'
entrypoint: bash
command:
- -uexc
- |
exec conda run -n mit-py311 --no-capture-output celery --app moeflow_worker worker --queues mit --loglevel=debug --concurrency=8
links: [moeflow-rabbitmq, moeflow-mongodb]
profiles: [mit-worker]
depends_on: *backend-deps
moeflow-frontend:
image: ${GHCR_DOMAIN}/${MOEFLOW_FRONTEND_IMAGE}:${MOEFLOW_FRONTEND_VERSION}
restart: unless-stopped
volumes:
- ./nginx/templates:/etc/nginx/templates
- ./nginx/certificates:/certificates
- ./storage:/storage
# - ../moeflow-frontend/build:/build
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
environment:
DOMAIN: ${DOMAIN}
MAX_CONTENT_LENGTH_MB: ${MAX_CONTENT_LENGTH_MB}
links: [moeflow-backend]
networks:
- default
networks: #FIXME: can we remove this?
default:
name: moeflow