-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.base.yaml
58 lines (51 loc) · 1.25 KB
/
docker-compose.base.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
version: '2'
services:
db:
image: postgres:alpine
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data/
redis:
image: redis:alpine
api:
build:
context: ./backend
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- DEBUG=${DEBUG}
- SECRET_KEY=${SECRET_KEY}
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}
- SQL_ENGINE=${SQL_ENGINE}
- SQL_HOST=${SQL_HOST}
- SQL_PORT=${SQL_PORT}
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
celery:
extends:
service: api
user: app
command:
celery -A backend worker -B --loglevel=info
depends_on:
- db
- redis
django:
extends:
service: api
command:
gunicorn backend.wsgi:application --user app --group app --bind 0.0.0.0:8000
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
depends_on:
- db
- celery
volumes:
postgres_data:
static_volume:
media_volume: