-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
61 lines (61 loc) · 1.76 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
services:
django:
image: history4feed
build: .
command: >
bash -c "
python manage.py collectstatic --no-input &&
python manage.py makemigrations &&
python manage.py migrate &&
gunicorn history4feed.wsgi:application --bind 0.0.0.0:8002 --reload
"
volumes:
- .:/usr/src/app/
ports:
- 8002:8002
environment:
- DEBUG=1
- DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] django
- CELERY_BROKER_URL=redis://redis:6379/0
env_file:
- ./.env
depends_on:
pgdb:
condition: service_healthy
redis:
condition: service_started
celery:
image: history4feed
build: .
command: >
bash -c "
celery -A history4feed.h4fscripts worker -l INFO
"
volumes:
- .:/usr/src/app
environment:
- DEBUG=1
- DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
- CELERY_BROKER_URL=redis://redis:6379/0
- result_backend=redis://redis:6379/1
env_file:
- ./.env
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: