-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (70 loc) · 1.56 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
x-backend-service: &x-backend-service
build: .
env_file:
- .env
restart: unless-stopped
services:
migrate:
<<: *x-backend-service
depends_on:
- postgres
command: python manage.py migrate --noinput
restart: "no"
backend:
<<: *x-backend-service
expose:
- 8000
volumes:
- static_volume:/app/static
depends_on:
migrate:
condition: service_completed_successfully
command: [ "gunicorn", "-c", "/app/app/gunicorn.py", "app.wsgi" ]
bot:
<<: *x-backend-service
expose:
- 8080
depends_on:
migrate:
condition: service_completed_successfully
command: python manage.py run_bot
celery-worker:
<<: *x-backend-service
depends_on:
- bot
- postgres
- redis
command: celery -A app worker --loglevel=info
celery-beat:
<<: *x-backend-service
depends_on:
- celery-worker
command: celery -A app beat --loglevel=info
nginx:
image: nginx:1.25-alpine
ports:
- "8000:80"
volumes:
- static_volume:/static
- ./nginx/static/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- backend
- bot
postgres:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres # Need a better password
volumes:
- postgres_data:/var/lib/postgresql/data/
redis:
image: redis:alpine
command: redis-server
environment:
- REDIS_REPLICATION_MODE=master
volumes:
- redis_data:/data
volumes:
redis_data:
postgres_data:
static_volume: