-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
143 lines (134 loc) · 3.12 KB
/
docker-compose.yml
File metadata and controls
143 lines (134 loc) · 3.12 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
services:
web:
restart: always
env_file:
- .env
build:
context: .
dockerfile: deployments/compose/django/Dockerfile
command: /start
volumes:
- .:/app
ports:
- ${PORT:-8001}:8000
depends_on:
- pgbouncer
# - rabbitmq
- redis
bot:
build:
context: .
dockerfile: deployments/compose/bot/Dockerfile
command: python apps/bot/main.py
volumes:
- .:/app
depends_on:
- web
- redis
restart: always
db:
image: postgres:16-alpine
restart: always
env_file:
- .env
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
pgbouncer:
image: pgbouncer/pgbouncer:latest
restart: always
environment:
- DATABASES_AUTH_USER=${POSTGRES_USER}
- DATABASES_CLIENT_SIDE_DBNAME=${POSTGRES_DB}
- DATABASES_USER=${POSTGRES_USER}
- DATABASES_PASSWORD=${POSTGRES_PASSWORD}
- DATABASES_DBNAME=${POSTGRES_DB}
- DATABASES_HOST=${POSTGRES_HOST}
- DATABASES_PORT=${POSTGRES_PORT:-5432}
- PGBOUNCER_DEFAULT_POOL_SIZE=100
- PGBOUNCER_MAX_CLIENT_CONN=10000
- PGBOUNCER_LISTEN_PORT=${POSTGRES_BOUNCER_PORT:-6432}
- PGBOUNCER_LISTEN_ADDR=*
- PGBOUNCER_LOGFILE=/var/log/pgbouncer/pgbouncer.log
volumes:
- pgbouncer_data:/etc/pgbouncer
ports:
- ${POSTGRES_BOUNCER_PORT:-6432}:6432
depends_on:
db:
condition: service_healthy
redis:
image: redis:latest
restart: always
# rabbitmq:
# image: rabbitmq:management
# env_file:
# - .env
# restart: always
# environment:
# - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
# - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
# ports:
# - ${RABBITMQ_PORT:-15672}:15672
# - ${AMQP_PORT:-5672}:5672
# volumes:
# - rabbitmq:/var/lib/rabbitmq
celery_worker:
build:
context: .
dockerfile: ./deployments/compose/django/Dockerfile
command: /start-celeryworker
restart: always
volumes:
- .:/app
env_file:
- .env
depends_on:
- redis
# - rabbitmq
- pgbouncer
# celery_beat:
# build:
# context: .
# dockerfile: ./deployments/compose/django/Dockerfile
# command: /start-celerybeat
# restart: always
# volumes:
# - .:/app
# env_file:
# - .env
# depends_on:
# - redis
# - rabbitmq
# - pgbouncer
# celery-flower:
# env_file:
# - .env
# build:
# context: .
# dockerfile: ./deployments/compose/django/Dockerfile
# command: /start-flower
# restart: always
# volumes:
# - .:/app
# ports:
# - ${CELERY_FLOWER:-5555}:5555
# depends_on:
# - redis
# - rabbitmq
# - pgbouncer
volumes:
pg_data:
driver: local
pgbouncer_data:
driver: local
# rabbitmq:
# driver: local