-
Notifications
You must be signed in to change notification settings - Fork 43
/
docker-compose.yml
59 lines (49 loc) · 1.53 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
{% set num_splashes = cookiecutter.num_splashes|int %}
{% set splash_slots = cookiecutter.splash_slots|int %}
{% set max_timeout = cookiecutter.max_timeout|int %}
{% set maxrss = cookiecutter.maxrss_mb | int %}
{% set mem_limit = "%dm" | format(maxrss * 1.4) %}
{% set memswap_limit = "%dm" | format(maxrss * 1.8) %}
{% set tor = cookiecutter.tor | int %}
{% set verbosity = cookiecutter.splash_verbosity %}
version: '2'
services:
haproxy:
image: haproxy:1.7
ports:
# stats
- "8036:8036"
# splash
- "8050:8050"
links:
{%- for i in range(num_splashes) %}
- splash{{i}}
{%- endfor %}
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
{%- for i in range(num_splashes) %}
splash{{i}}:
image: scrapinghub/splash:{{ cookiecutter.splash_version }}
command: --max-timeout {{ max_timeout }} --slots {{ splash_slots }} --maxrss {{ maxrss }} --verbosity {{ verbosity }}
expose:
- 8050
mem_limit: {{ mem_limit }}
memswap_limit: {{ memswap_limit }}
restart: always
{%- if tor %}
links:
- tor
volumes:
- ./proxy-profiles:/etc/splash/proxy-profiles:ro
- ./filters:/etc/splash/filters:ro
{%- endif %}
{%- endfor %}
{% if tor %}
tor:
image: jess/tor-proxy
expose:
- 9050
logging:
driver: "none"
restart: always
{% endif %}