-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
70 lines (65 loc) · 1.42 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
services:
database:
image: postgres:17.4
container_name: database
restart: always
ports:
- "5432:5432"
volumes:
- database:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
cache:
image: redis:7.4.2
container_name: cache
restart: always
ports:
- "6379:6379"
rabbitmq:
image: rabbitmq:3-management
container_name: broker
restart: always
ports:
- "15672:15672"
- "5672:5672"
env_file:
- .env
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "ping" ]
interval: 10s
timeout: 5s
retries: 3
web:
build: .
container_name: backend
command: [ "./wait-for-it.sh", "database:5432", "--",
"sh", "-c", "python manage.py migrate && uwsgi --ini /code/config/uwsgi/uwsgi.ini" ]
restart: always
volumes:
- .:/code
ports:
- "8000:8000"
env_file:
- .env
depends_on:
- cache
- rabbitmq
- database
nginx:
image: nginx:1.27.4
container_name: nginx
restart: always
volumes:
- ./config/nginx:/etc/nginx/templates
- .:/code
ports:
- "80:80"
volumes:
database: