-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (110 loc) · 2.67 KB
/
docker-compose.yml
File metadata and controls
117 lines (110 loc) · 2.67 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
services:
postgres:
image: postgres:17.5-alpine3.22
container_name: postgres
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "${POSTGRES_OUT_PORT}:${POSTGRES_PORT}"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 5s
timeout: 3s
retries: 5
networks:
- taskflow_net
redis:
image: redis:8.0.3-alpine
container_name: redis
restart: unless-stopped
env_file:
- .env
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
ports:
- "${REDIS_OUT_PORT}:${REDIS_PORT}"
volumes:
- redis_data:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf:ro
networks:
- taskflow_net
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
minio:
build: ./minio
container_name: minio
ports:
- "${MINIO_OUT_WEB_PORT}:${MINIO_WEB_PORT}"
expose:
- "${MINIO_STORAGE_PORT}" # expose — только для внутренней сети Docker, не наружу
volumes:
- minio_data:/data
env_file:
- .env
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:${MINIO_WEB_PORT}/minio/health/live" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
networks:
- taskflow_net
web:
build: .
container_name: taskflow_web
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
env_file:
- .env
environment:
MIGRATION_INSIDE_DOCKER: 1
expose:
- "8000"
volumes:
- ./src:/fast_api/src
networks:
- taskflow_net
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/task_flow/health" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
command: ["sh", "-c", "alembic upgrade head && fastapi dev src/main.py --host 0.0.0.0"]
nginx:
image: nginx:stable-alpine
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/errors/:/etc/nginx/errors/:ro
networks:
- taskflow_net
depends_on:
- web
volumes:
postgres_data:
redis_data:
minio_data:
networks:
taskflow_net:
name: taskflow_net
driver: bridge