-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
232 lines (223 loc) · 5.88 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
227
228
229
230
231
232
services:
localstack:
restart: always
build:
context: .
dockerfile: ./docker/localstack/Dockerfile
environment:
- SERVICES=s3
- PERSISTENCE=/tmp/localstack/data
- DOCKER_HOST=unix:///var/run/docker.sock
ports:
- '4566:4566'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./tmp/localstack:/var/lib/localstack
- ./tmp/uploads:/tmp/localstack-s3-storage
- ./docker/localstack/aws:/etc/localstack/init/ready.d
healthcheck:
test: ['CMD', 'awslocal', 's3api', 'wait', 'bucket-exists', '--bucket', 'bucket-name']
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
- backend
redis:
restart: always
image: redis/redis-stack:latest
environment:
- REDISTIMESERIES_ARGS="RETENTION_POLICY=20"
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
ports:
- '6379:6379'
- '8001:8001'
networks:
- backend
browserless:
restart: always
image: browserless/chrome:1.61-puppeteer-21.4.1
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/?token=sandbox']
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
environment:
# - FUNCTION_ENABLE_INCOGNITO_MODE=true
- PREBOOT_CHROME=true
# - KEEP_ALIVE=true
# - SINGLE_RUN=true
- MAX_CONCURRENT_SESSIONS=1
- QUEUE_LENGTH=1
- CHROME_REFRESH_TIME=900000
- WORKSPACE_DELETE_EXPIRED=true
- WORKSPACE_EXPIRE_DAYS=1
- ENABLE_DEBUGGER=true
- DEFAULT_BLOCK_ADS=true
- DEFAULT_IGNORE_HTTPS_ERRORS=true
- DEFAULT_USER_DATA_DIR=/tmp/browserless-profile
- ENABLE_CORS=true
- EXIT_ON_HEALTH_FAILURE=true
- FUNCTION_BUILT_INS=["crypto"]
- FUNCTION_EXTERNALS=["request","fetch"]
- TOKEN=sandbox
ports:
- 3000:3000
volumes:
- ./tmp/browserless/profile:/tmp/browserless-profile
networks:
- backend
brightdata:
restart: always
platform: linux/amd64
image: luminati/luminati-proxy
command: proxy-manager
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:22999/api/proxies']
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
volumes:
- ./docker/brightdata:/root/proxy_manager
networks:
- backend
scrapoxy:
restart: always
image: fabienvauchelles/scrapoxy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8890']
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
environment:
- NODE_ENV=production
- AUTH_LOCAL_USERNAME=admin
- AUTH_LOCAL_PASSWORD=password
- BACKEND_JWT_SECRET=secret1
- FRONTEND_JWT_SECRET=secret2
- STORAGE_FILE_FILENAME=/cfg/scrapoxy.json
volumes:
- ./docker/scrapoxy/scrapoxy.json:/cfg/scrapoxy.json
networks:
- backend
proxypy:
stdin_open: true # docker run -i
tty: true # docker run -t
# https://proxypy.readthedocs.io/en/latest/#http-proxy-plugins
command: "--data-dir /data --cache-dir /cache --ca-cert-dir /cert --ca-key-file /cert/ca-key.pem --ca-cert-file /cert/ca-cert.pem --ca-signing-key-file /cert/ca-signing-key.pem --hostname 0.0.0.0 --port 8899 --plugins proxy.plugin.CloudflareDnsResolverPlugin proxy.plugin.CacheResponsesPlugin"
build:
context: .
dockerfile: ./docker/proxypy/Dockerfile
ports:
- "8899:8899"
volumes:
- ./cert:/cert
- ./tmp/proxypy/cache:/cache
- ./tmp/proxypy/data:/data
networks:
- backend
proxy:
restart: always
build:
context: .
dockerfile: ./docker/serve.dockerfile
target: serve
args:
- NODE_ENV=development
- APP=proxy
working_dir: /usr/src/app
ports:
- '80:80'
- '9229:9229'
- '7777:7777'
command: /bin/sh -c 'yarn nx serve proxy --verbose'
environment:
- DEBUG=proxy*
- PORT=80
- PROXY_USER=${PROXY_USER}
- PROXY_PASS=${PROXY_PASS}
volumes:
- ./cert/:/cert
- ./:/usr/src/app
- ./node_modules:/usr/src/app/node_modules
networks:
- backend
api:
restart: always
build:
context: .
dockerfile: ./docker/serve.dockerfile
target: serve
args:
- NODE_ENV=development
- APP=api
working_dir: /usr/src/app
command: /bin/sh -c 'yarn nx serve api --verbose'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:80/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
environment:
- NODE_ENV=development
- APP=api
- DEBUG=api*
- PORT=80
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
localstack:
condition: service_healthy
redis:
condition: service_healthy
browserless:
condition: service_started
volumes:
- ./cert/:/cert/
- ./:/usr/src/app/
- ./node_modules:/usr/src/app/node_modules
networks:
- backend
nginx:
restart: always
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/sites-enabled/:/etc/nginx/sites-enabled/
- ./docker/nginx/modules/:/usr/local/nginx/modules/
- ./tmp/nginx/logs:/var/log/nginx
- ./cert/:/etc/nginx/certs/
ports:
- '9999:9999'
- '9000:9000'
- '8080:80'
- '8081:443'
- '22999:22999'
- '24000:24000'
- '8890:8890'
- '8888:8888'
depends_on:
api:
condition: service_healthy
proxy:
condition: service_started
brightdata:
condition: service_started
scrapoxy:
condition: service_started
networks:
- backend
networks:
backend:
driver: bridge