-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
60 lines (60 loc) · 1.67 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
services:
django_env:
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- POSTGRES_HOST=pgdb
- DEBUG=1
- DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] django
- CELERY_BROKER_URL=redis://redis:6379/0
- result_backend=redis://redis:6379/1
env_file:
- ./.env
build: .
image: django-stixify
# volumes:
# - ./tmp:/tmp/
django:
extends: django_env
command: >
bash -c "
python manage.py makemigrations &&
python manage.py migrate &&
gunicorn stixify.wsgi:application --bind 0.0.0.0:8004 --reload
"
volumes:
- .:/usr/src/app/
ports:
- 8004:8004
depends_on:
pgdb:
condition: service_healthy
redis:
condition: service_started
celery:
extends: django_env
command: >
bash -c "
celery -A stixify.worker worker -l INFO
"
volumes:
- .:/usr/src/app
depends_on:
- django
- redis
pgdb:
image: postgres
env_file:
- ./.env
volumes:
- pgdata:/var/lib/postgresql/data/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
redis:
image: "redis:alpine"
volumes:
pgdata: