-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
226 lines (210 loc) · 5.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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
version: "2.2"
x-logging-options: &default-logging-options
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
services:
captchamonitor: &captchamonitor_base_service
<<: *default-logging-options
image: captchamonitor
build:
context: .
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
tor-browser-container:
condition: service_healthy
firefox-browser-container:
condition: service_healthy
chrome-browser-container:
condition: service_healthy
env_file:
- .env
environment:
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=1
volumes:
- ./src:/src
- ./tests:/tests
- /var/run/docker.sock:/var/run/docker.sock
- tor_browser_profile_volume:/TorBrowserProfile
- shared_tmp_volume:/tmp
networks:
- captchamonitor_network
cm-worker:
<<: *captchamonitor_base_service
restart: always
entrypoint:
- python
- -m
- captchamonitor
- --worker
cm-analyzer:
<<: *captchamonitor_base_service
restart: always
entrypoint:
- python
- -m
- captchamonitor
- --analyzer
cm-updater:
<<: *captchamonitor_base_service
restart: always
entrypoint:
- python
- -m
- captchamonitor
- --updater
cm-dashboard:
<<: *captchamonitor_base_service
image: captchamonitor-dashboard-container
depends_on:
postgres:
condition: service_healthy
nginx:
condition: service_healthy
restart: always
entrypoint:
- python
- -m
- captchamonitor
- --dashboard
postgres:
<<: *default-logging-options
image: postgres:9.6
environment:
POSTGRES_USER: ${CM_DB_USER}
POSTGRES_PASSWORD: ${CM_DB_PASSWORD}
ports:
- "5432:5432"
volumes:
- ./captchamonitor-db-data:/var/lib/postgresql/data
networks:
- captchamonitor_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $CM_DB_USER"]
interval: 10s
timeout: 5s
retries: 5
nginx:
<<: *default-logging-options
image: nginx
ports:
- "5000:80"
volumes:
- ./src/captchamonitor/dashboard/www:/usr/share/nginx/html:ro
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 60s
timeout: 30s
retries: 5
tor-container:
<<: *default-logging-options
image: captchamonitor-tor-container:latest
build:
context: ./tor-container
dockerfile: Dockerfile
entrypoint:
# Basically do nothing on purpose, this container will be created and run
# as needed by the main code
- /bin/sh
healthcheck:
test: ["CMD", "service", "tor", "status"]
interval: 60s
timeout: 30s
retries: 5
tor-browser-container:
<<: *default-logging-options
image: captchamonitor-tor-browser-container:latest
build:
context: ./standalone-tor-browser
dockerfile: Dockerfile
labels:
- VERSION=latest
networks:
- captchamonitor_network
volumes:
- shared_tmp_volume:/tmp
- tor_browser_profile_volume:/opt/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default
shm_size: '2gb'
environment:
SE_OPTS: "-port 4444"
healthcheck:
test: ["CMD-SHELL", "/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444"]
interval: 15s
timeout: 30s
retries: 5
firefox-browser-container:
<<: *default-logging-options
image: selenium/standalone-firefox:3.141.59-20210607
volumes:
- shared_tmp_volume:/tmp
networks:
- captchamonitor_network
shm_size: '2gb'
environment:
SE_OPTS: "-port 4445"
healthcheck:
test: ["CMD-SHELL", "/opt/bin/check-grid.sh --host 0.0.0.0 --port 4445"]
interval: 15s
timeout: 30s
retries: 5
chrome-browser-container:
<<: *default-logging-options
image: selenium/standalone-chrome:3.141.59-20210607
volumes:
- shared_tmp_volume:/tmp
networks:
- captchamonitor_network
shm_size: '2gb'
environment:
SE_OPTS: "-port 4446"
healthcheck:
test: ["CMD-SHELL", "/opt/bin/check-grid.sh --host 0.0.0.0 --port 4446"]
interval: 15s
timeout: 30s
retries: 5
brave-browser-container:
<<: *default-logging-options
image: captchamonitor-brave-browser-container:latest
build:
context: ./standalone-brave-browser
dockerfile: Dockerfile
networks:
- captchamonitor_network
volumes:
- shared_tmp_volume:/tmp
shm_size: '2gb'
environment:
SE_OPTS: "-port 4447"
healthcheck:
test: ["CMD-SHELL", "/opt/bin/check-grid.sh --host 0.0.0.0 --port 4447"]
interval: 15s
timeout: 30s
retries: 5
opera-browser-container:
<<: *default-logging-options
image: selenium/standalone-opera:3.141.59-20210607
volumes:
- shared_tmp_volume:/tmp
networks:
- captchamonitor_network
shm_size: '2gb'
environment:
SE_OPTS: "-port 4448"
healthcheck:
test: ["CMD-SHELL", "/opt/bin/check-grid.sh --host 0.0.0.0 --port 4448"]
interval: 15s
timeout: 30s
retries: 5
networks:
captchamonitor_network:
driver: bridge
volumes:
tor_browser_profile_volume:
external: false
shared_tmp_volume:
external: false