-
Notifications
You must be signed in to change notification settings - Fork 129
/
docker-compose.yml
185 lines (173 loc) · 4.96 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
version: '2'
services:
# --------------------------------------------------------------------------
# HTTP Server
# --------------------------------------------------------------------------
nginx:
image: nginx
ports:
- ${NGINX_PORT}:${NGINX_PORT}
- ${SSL_PORT}:${SSL_PORT}
command: bash -x /app/docker/run_nginx.sh
volumes:
- ./certs:/app/certs
- ./docker:/app/docker
- ./codalab:/app/codalab
- ${LOGGING_DIR}/nginx:/var/log/nginx/
env_file: .env
links:
- django:django
logging:
options:
max-size: "200k"
container_name: nginx
# --------------------------------------------------------------------------
# Database
# --------------------------------------------------------------------------
postgres:
image: postgres:9.6.3
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- ./docker:/app/docker
- ${LOGGING_DIR}/psql:/var/log/psql
- ${DB_DATA_PATH}:/var/lib/postgresql/data
- ./backups:/app/backups
env_file: .env
logging:
options:
max-size: "200k"
container_name: postgres
# --------------------------------------------------------------------------
# Message queue
# --------------------------------------------------------------------------
rabbit:
build:
# Custom Dockerfile for rabbit mostly to make building faster because
# of envsubst dependency
context: .
dockerfile: docker/rabbitmq/Dockerfile
hostname: rabbit
command: bash -x /app/docker/run_rabbitmq.sh
environment:
- RABBITMQ_LOGS=/var/log/rabbitmq/output.log
- RABBITMQ_SASL_LOGS=/var/log/rabbitmq/output_sasl.log
env_file: .env
volumes:
- ./docker:/app/docker
- ./certs:/app/certs
- ${LOGGING_DIR}/rabbitmq:/var/log/rabbitmq
- ./var/data/rabbitmq/:/var/lib/rabbitmq/mnesia
ports:
- ${RABBITMQ_PORT}:${RABBITMQ_PORT}
- ${RABBITMQ_MANAGEMENT_PORT}:${RABBITMQ_MANAGEMENT_PORT}
logging:
options:
max-size: "200k"
container_name: rabbit
flower:
build:
context: .
dockerfile: docker/flower/Dockerfile
hostname: flower
ports:
- ${FLOWER_PORT}:${FLOWER_PORT}
environment:
# These aren't set in .env
- AMQP_USERNAME=${RABBITMQ_DEFAULT_USER}
- AMQP_PASSWORD=${RABBITMQ_DEFAULT_PASS}
- AMQP_HOST=rabbit
- AMQP_PORT=${RABBITMQ_PORT}
- FLOWER_CERTFILE=${SSL_CERTIFICATE}
- FLOWER_KEYFILE=${SSL_CERTIFICATE_KEY}
volumes:
- ./certs:/app/certs
env_file: .env
links:
- rabbit
logging:
options:
max-size: "200k"
container_name: flower
# --------------------------------------------------------------------------
# Cache
# --------------------------------------------------------------------------
memcached:
image: memcached
hostname: memcached
command: "/usr/local/bin/memcached -u memcache"
logging:
options:
max-size: "200k"
container_name: memcached
# --------------------------------------------------------------------------
# Django
# --------------------------------------------------------------------------
django:
build:
context: .
dockerfile: Dockerfile
hostname: django
ports:
- ${DJANGO_PORT}:${DJANGO_PORT}
command: bash /app/docker/run_django.sh
volumes:
- ./certs:/app/certs
- ./codalab:/app/codalab
- ./docker:/app/docker
- ${LOGGING_DIR}/django:/var/log/django/
- ./backups:/app/backups
env_file: .env
environment:
- CONFIG_SERVER_NAME=${CODALAB_SITE_DOMAIN}
- PYTHONUNBUFFERED=1
links:
- postgres
- rabbit
- memcached
logging:
options:
max-size: "200k"
container_name: django
# --------------------------------------------------------------------------
# Celery Workers
# --------------------------------------------------------------------------
worker_site:
build:
context: .
dockerfile: Dockerfile
command: sh /app/docker/run_site.sh
volumes:
- ./codalab:/app/codalab
- ./docker:/app/docker
- ${LOGGING_DIR}/worker_site:/var/log/
environment:
# Stop memory leaks
- DEBUG=False
- REQUESTS_CA_BUNDLE=/usr/local/lib/python3.8/site-packages/certifi/cacert.pem
env_file: .env
links:
- postgres
- rabbit
logging:
options:
max-size: "200k"
container_name: worker_site
worker_compute:
image: codalab/competitions-v1-compute-worker:1.1.7
privileged: true
volumes:
- ${LOGGING_DIR}/worker_compute:/var/log/
- ${SUBMISSION_TEMP_DIR}:${SUBMISSION_TEMP_DIR}
- /var/run/docker.sock:/var/run/docker.sock
env_file: .env
links:
- rabbit
logging:
options:
max-size: "200k"
mem_limit: 1g
memswap_limit: 1g
container_name: worker_compute