This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
97 lines (89 loc) · 1.86 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
version: '3.9'
services:
api:
container_name: api
stdin_open: true
tty: true
build:
context: .
dockerfile: Dockerfile
command: dockerize -wait tcp://paul-db:5432 -timeout 90s -- web
env_file:
- .env
environment:
- "PYTHONUNBUFFERED=1"
ports:
- "8037:8000"
volumes:
- ./paul_api/media:/var/www/paul-api/media
- ./paul_api:/opt/paul_api/
restart: on-failure
depends_on:
- paul-db
# Redis is only needed for Celery
# - redis
paul-db:
hostname: paul-db
image: postgres:12
ports:
- "5434:5432"
env_file:
- .env
volumes:
- database-data:/var/lib/postgresql/data/
restart: on-failure
redis:
image: redis:latest
ports:
- '6879:6379'
profiles:
- with-task-queue
restart: on-failure
celery_worker:
build:
context: .
dockerfile: Dockerfile
command: dockerize -wait tcp://paul-db:5432 -wait tcp://redis:6379 -timeout 90s -- celery
depends_on:
- api
- paul-db
- redis
profiles:
- with-task-queue
env_file:
- .env
deploy:
# replicas: 2
restart_policy:
condition: on-failure
resources:
limits:
memory: 200M
restart: on-failure
celery_beat:
build:
context: .
dockerfile: Dockerfile
command: dockerize -wait tcp://paul-db:5432 -wait tcp://redis:6379 -timeout 90s -- celerybeat
depends_on:
- api
- paul-db
- redis
profiles:
- with-task-queue
env_file:
- .env
restart: on-failure
flower:
image: mher/flower:0.9.5
command: ["flower", "--broker=redis://redis:6379/0", "--port=8888"]
ports:
- "8787:8888"
depends_on:
- redis
profiles:
- with-task-queue
volumes:
database-data:
name: paul-pgdata
media: