-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdocker-compose.yml
154 lines (152 loc) · 3.95 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: '3.7'
services:
redis:
image: redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
restart: always
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
env_file:
- ./docker/config/main.env
healthcheck:
test: ["CMD", "nc", "-vz", "zookeeper", "2181"]
interval: 1s
timeout: 3s
retries: 30
restart: always
kafka:
image: wurstmeister/kafka:2.12-2.5.0
ports:
- "9092:9092"
env_file:
- ./docker/config/main.env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
zookeeper:
condition: service_healthy
healthcheck:
test: ["CMD", "nc", "-vz", "kafka", "9092"]
interval: 1s
timeout: 3s
retries: 30
restart: always
web:
build:
context: .
dockerfile: ./docker/django-gunicorn/Dockerfile
command: ./django_run.sh
volumes:
- static_volume:/usr/src/app/staticfiles
- data:/data
- migrations:/usr/src/app/main/migrations
expose:
- 8000
env_file:
- ./docker/config/${ENVFILENAME}.env
depends_on:
kafka:
condition: service_healthy
db:
condition: service_healthy
restart: on-failure
nginx:
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
volumes:
- static_volume:/home/nginx/staticfiles
ports:
- 8000:8080
depends_on:
- web
db:
image: postgres:12.0-alpine
hostname: localhost
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./docker/config/main.env
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
link_generator:
build:
context: .
dockerfile: ./docker/link_generator/Dockerfile
env_file:
- ./docker/config/main.env
depends_on:
redis:
condition: service_healthy
kafka:
condition: service_healthy
restart: on-failure
spider_manager:
build:
context: .
dockerfile: ./docker/spider_manager/Dockerfile
init: true
env_file:
- ./docker/config/main.env
volumes:
- data:/data
depends_on:
redis:
condition: service_healthy
kafka:
condition: service_healthy
restart: on-failure
writer:
build:
context: .
dockerfile: ./docker/writer/Dockerfile
volumes:
- data:/data
env_file:
- ./docker/config/main.env
depends_on:
kafka:
condition: service_healthy
restart: on-failure
scheduler:
build:
context: .
dockerfile: ./docker/scheduler/Dockerfile
volumes:
- data:/data
env_file:
- ./docker/config/main.env
depends_on:
kafka:
condition: service_healthy
db:
condition: service_healthy
restart: on-failure
volumes:
static_volume:
data:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: './data'
migrations:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: './main/migrations'
postgres_data: