-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
100 lines (85 loc) · 1.84 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
98
99
100
# 1
services:
backend:
container_name: lms-backend
build: .
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn config.wsgi:application --bind 0.0.0.0:8000"
environment:
- POSTGRES_HOST=db
volumes:
- .:/app
- static_volume:/app/staticfiles
expose:
- "8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
db:
container_name: lms-db
image: postgres:16.0
env_file:
- .env
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
interval: 3s
timeout: 3s
retries: 10
redis:
image: redis:latest
container_name: lms-redis
command: ["redis-server", "--maxmemory", "256mb", "--maxmemory-policy", "allkeys-lru"]
env_file:
- .env
volumes:
- redis_data:/data
healthcheck:
test: redis-cli ping
interval: 3s
timeout: 3s
retries: 10
celery:
container_name: lms-celery_worker
build: .
command: celery -A config worker -l info
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
celery-beat:
container_name: lms-celery_beat
build: .
command: celery -A config beat -l info
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
nginx:
build: ./nginx
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- static_volume:/app/staticfiles
depends_on:
- backend
networks:
default:
volumes:
postgres_data:
static_volume:
redis_data: