-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
126 lines (118 loc) · 2.34 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: "3.8"
services:
rabbitmq:
image: "rabbitmq:3-management"
ports:
- "8888:15672"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
start_period: 60s
networks:
- n_core
volumes:
- rabbitmq_data:/var/lib/rabbitmq
redis:
image: "redis"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 30s
retries: 3
start_period: 30s
networks:
- n_core
volumes:
- redis_data:/data
mongodb:
image: "mongo"
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 30s
timeout: 30s
retries: 3
start_period: 30s
networks:
- n_core
volumes:
- mongodb_data:/data/db
downloader:
image: "nil1729/yt-dl-fast-api"
environment:
- PORT=9090
deploy:
replicas: 4
restart_policy:
max_attempts: 3
condition: on-failure
healthcheck:
test: curl -vvv 0.0.0.0:9090
interval: 30s
timeout: 30s
retries: 3
start_period: 30s
networks:
- n_downloader
volumes:
- downloads_data:/usr/downloads
downloader_lb:
build:
context: ./lb/downloader
dockerfile: Dockerfile
depends_on:
downloader:
condition: service_healthy
restart: always
networks:
- n_core
- n_downloader
core:
build:
context: .
dockerfile: Dockerfile
env_file:
- ./_local/docker.env
depends_on:
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
mongodb:
condition: service_healthy
downloader_lb:
condition: service_started
deploy:
replicas: 2
restart_policy:
max_attempts: 3
condition: on-failure
networks:
- n_core
volumes:
- downloads_data:/tmp/m-dl/downloads
- tmp_data:/opt/m-dl
gateway:
build:
context: ./lb/core
dockerfile: Dockerfile
ports:
- "9999:80"
depends_on:
core:
condition: service_started
restart: always
networks:
- n_core
- n_gateway
networks:
n_core:
n_downloader:
n_gateway:
volumes:
mongodb_data:
redis_data:
rabbitmq_data:
downloads_data:
tmp_data: