-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
137 lines (131 loc) · 3.59 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
version: '3'
services:
#-----------------------------------------------
# Web Services
#-----------------------------------------------
caddy:
image: abiosoft/caddy:1.0.3
env_file: .env
environment:
- ACME_AGREE=true
volumes:
- ./Caddyfile:/etc/Caddyfile
- ./src/staticfiles:/var/www/django/static
- ./certs/caddy:/etc/caddycerts
restart: unless-stopped
ports:
- 80:80
- 443:443
depends_on:
- django
django:
build: .
command: bash -c "cd /app/src && watchmedo auto-restart -p '*.py' --recursive -- gunicorn asgi:application -w 2 -k uvicorn.workers.UvicornWorker -b :8000"
environment:
- DJANGO_SETTINGS_MODULE=settings.base
- DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
env_file: .env
volumes:
- .:/app
- /tmp/codalab-v2/django:/codalab_tmp
restart: unless-stopped
ports:
- ${DJANGO_PORT}:8000
depends_on:
- postgres
- elasticsearch
- rabbit
stdin_open: true
tty: true
logging:
options:
max-size: "20k"
max-file: "10"
# --------------------------------------------------------------------------
# Database
# --------------------------------------------------------------------------
postgres:
image: postgres:9.6.15
ports:
- 5433:5432
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- ${LOGGING_DIR}/psql:/var/log/psql
- ${DB_DATA_PATH}:/var/lib/postgresql/data
- ./backups:/app/backups
restart: unless-stopped
env_file: .env
logging:
options:
max-size: "20k"
# --------------------------------------------------------------------------
# Elastic Search
# --------------------------------------------------------------------------
elasticsearch:
image: elasticsearch:7.4.0
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms750m -Xmx750m"
ports:
- 9200:9200
volumes:
- ./var/data/elasticsearch:/usr/share/elasticsearch/data
restart: unless-stopped
env_file: .env
logging:
options:
max-size: "20k"
#-----------------------------------------------
# Rabbitmq Service
#-----------------------------------------------
rabbit:
image: rabbitmq:3.8-management
env_file: .env
ports:
- 15672:15672
- 5672:5672
volumes:
# To save rabbit state between container ups/downs
- ./var/rabbit:/var/lib/rabbit/:delegated
restart: unless-stopped
logging:
options:
max-size: "20k"
max-file: "10"
#-----------------------------------------------
# Celery Service
#-----------------------------------------------
site_worker:
command: bash -c "watchmedo auto-restart -p '*.py' --recursive -- celery -A celery_config worker -Q site-worker -l info -n site-worker@%n"
working_dir: /app/src
build:
context: .
depends_on:
- rabbit
- postgres
environment:
- DJANGO_SETTINGS_MODULE=settings.base
env_file: .env
volumes:
- .:/app
restart: unless-stopped
logging:
options:
max-size: "20k"
max-file: "10"
#-----------------------------------------------
# Local development helper, rebuilds RiotJS/Stylus on change
#-----------------------------------------------
builder:
build:
context: .
dockerfile: Dockerfile.builder
volumes:
- .:/app
logging:
options:
max-size: "20k"
max-file: "10"