-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.prod.yml
109 lines (107 loc) · 2.27 KB
/
docker-compose.prod.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
version: "3.9"
services:
web:
build:
context: .
dockerfile: Dockerfile.prod
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/home/app/web/staticfiles
- media_volume:/home/app/web/mediafiles
expose:
- 8000
env_file:
- ./.env
depends_on:
- db
restart: always
db:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env
restart: always
redis:
image: redis
ports:
- 6379:6379
env_file:
- ./.env
command: >
--requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
restart: always
nginx:
build: ./nginx
volumes:
- static_volume:/home/app/web/staticfiles
- media_volume:/home/app/web/mediafiles
ports:
- 80:80
depends_on:
- web
restart: always
celeryworker:
container_name: celeryworker
restart: always
build: .
env_file:
- ./.env
command: celery -A core worker --pool=prefork -l info
depends_on:
- redis
celeryscheduler:
container_name: celeryscheduler
build: .
env_file:
- ./.env
command: celery -A core beat --loglevel=info --scheduler django_celery_beat.schedulers:DatabaseScheduler
depends_on:
- celeryworker
restart: always
celeryflower:
container_name: celeryflower
build: .
env_file:
- ./.env
command: celery -A core flower -l info
expose:
- 5555
ports:
- 5555:5555
depends_on:
- celeryworker
- celeryscheduler
restart: always
grafana:
image: grafana/grafana
ports:
- 3000:3000
volumes:
- grafana_storage:/var/lib/grafana
restart: always
prometheus:
image: prom/prometheus
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
restart: always
postgres-exporter:
image: prometheuscommunity/postgres-exporter
ports:
- 9187:9187
environment:
DATA_SOURCE_NAME: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/postgres?sslmode=disable"
links:
- db
- prometheus
restart: always
volumes:
postgres_data:
redis_data:
grafana_storage:
static_volume:
media_volume: