-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
104 lines (95 loc) · 2.1 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
101
102
103
104
version: '3'
volumes:
pg_data:
static:
media:
redis_data:
redis_conf:
logs:
services:
db:
image: postgres:16.2-alpine
env_file: ./infra/.env
restart: always
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 3s
retries: 3
start_period: 3s
redis:
image: redis:alpine
env_file: ./infra/.env
restart: always
volumes:
- redis_data:/root/redis
- redis_conf:/usr/local/etc/redis/redis.conf
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
backend:
build:
context: ./
dockerfile: ./backend/Dockerfile
env_file: ./infra/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command:
["gunicorn", "--bind", "0.0.0.0:8000", "config.wsgi"]
volumes:
- media:/app/media
- static:/backend_static
- logs:/logs
celery-worker:
build:
context: ./
dockerfile: ./backend/Dockerfile
env_file: ./infra/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: celery -A config worker -l info
volumes:
- media:/app/media
- static:/backend_static
- logs:/logs
minio:
image: minio/minio:latest
volumes:
- ./minio:/minio_files
env_file: ./infra/.env
command: 'minio server /minio_files --console-address ":9001"'
ports:
- 9000:9000
- 9001:9001
createbuckets:
image: minio/mc
depends_on:
- minio
env_file: ./infra/.env
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add --quiet --api s3v4 s3 http://minio:9000 minioadmin minioadmin;
/usr/bin/mc mb --quiet s3/running-app;
/usr/bin/mc anonymous set public s3/running-app;
"
nginx:
build: ./infra/
depends_on:
- backend
- celery-worker
- minio
ports:
- 8000:80
volumes:
- static:/static
- media:/media