This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-http-proxy.yml
117 lines (117 loc) · 3.71 KB
/
docker-compose-http-proxy.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
# ------------------------------------------------------------------------------
# Ref: https://docs.docker.com/compose/compose-file/
#
# Setup:
# Copy .env.example to .env and modify values as required.
# docker-compose -f docker-compose.yml -f docker-compose-http-proxy.yml build
# docker-compose -f docker-compose.yml -f docker-compose-http-proxy.yml down
#
# Run HTTP/1.1 PROXY (Varnish) example:
# docker-compose -f docker-compose.yml -f docker-compose-http-proxy.yml up -d
#
# HATop usage:
# docker-compose exec haproxy hatop --help
# docker-compose exec haproxy hatop -s /var/lib/haproxy/stats-1 -i 1
# docker-compose exec haproxy hatop -s /var/lib/haproxy/stats-2 -i 1
# docker-compose exec haproxy hatop -s /var/lib/haproxy/stats-3 -i 1
# docker-compose exec haproxy hatop -s /var/lib/haproxy/stats-4 -i 1
#
# Varnish usage:
# docker-compose -f docker-compose.yml -f docker-compose-http-proxy.yml \
# exec varnish1 varnishadm help
# ------------------------------------------------------------------------------
version: "3.0"
networks:
tier2:
driver: "bridge"
internal: true
services:
haproxy:
environment:
HAPROXY_CONFIG: "/etc/haproxy/haproxy-http-proxy.cfg"
apache-php1:
environment:
APACHE_CUSTOM_LOG_LOCATION: "/dev/null"
networks:
tier2:
aliases:
- "apache-php.1"
- "httpd_1"
apache-php2:
environment:
APACHE_CUSTOM_LOG_LOCATION: "/dev/null"
networks:
tier2:
aliases:
- "apache-php.2"
- "httpd_2"
varnish1:
environment:
ENABLE_VARNISHNCSA_WRAPPER: "true"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
VARNISH_MAX_THREADS: "${VARNISH_MAX_THREADS}"
VARNISH_MIN_THREADS: "${VARNISH_MIN_THREADS}"
VARNISH_OPTIONS: "${VARNISH_OPTIONS}"
VARNISH_STORAGE: "${VARNISH_STORAGE}"
VARNISH_THREAD_TIMEOUT: "${VARNISH_THREAD_TIMEOUT}"
VARNISH_TTL: "${VARNISH_TTL}"
VARNISH_VARNISHNCSA_FORMAT: "${VARNISH_VARNISHNCSA_FORMAT}"
VARNISH_VARNISHNCSA_OPTIONS: "${VARNISH_VARNISHNCSA_OPTIONS}"
VARNISH_VCL_CONF: "/var/run/secrets/varnish_vcl_default"
image: "jdeathe/centos-ssh-varnish:2.5.0"
networks:
tier2:
tier3:
aliases:
- "varnish.1"
- "varnish_1"
restart: "always"
sysctls:
net.core.somaxconn: "4096"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
tty: true
ulimits:
memlock: 82000
nofile:
soft: 524288
hard: 1048576
nproc: 65535
volumes:
# Emulate docker swarm secrets
- "${PWD:-.}/test/fixture/secrets:/var/run/secrets:ro"
varnish2:
environment:
ENABLE_VARNISHNCSA_WRAPPER: "true"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
VARNISH_MAX_THREADS: "${VARNISH_MAX_THREADS}"
VARNISH_MIN_THREADS: "${VARNISH_MIN_THREADS}"
VARNISH_OPTIONS: "${VARNISH_OPTIONS}"
VARNISH_STORAGE: "${VARNISH_STORAGE}"
VARNISH_THREAD_TIMEOUT: "${VARNISH_THREAD_TIMEOUT}"
VARNISH_TTL: "${VARNISH_TTL}"
VARNISH_VARNISHNCSA_FORMAT: "${VARNISH_VARNISHNCSA_FORMAT}"
VARNISH_VARNISHNCSA_OPTIONS: "${VARNISH_VARNISHNCSA_OPTIONS}"
VARNISH_VCL_CONF: "/var/run/secrets/varnish_vcl_default"
image: "jdeathe/centos-ssh-varnish:2.4.1"
networks:
tier2:
tier3:
aliases:
- "varnish.2"
- "varnish_2"
restart: "always"
sysctls:
net.core.somaxconn: "4096"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
tty: true
ulimits:
memlock: 82000
nofile:
soft: 524288
hard: 1048576
nproc: 65535
volumes:
# Emulate docker swarm secrets
- "${PWD:-.}/test/fixture/secrets:/var/run/secrets:ro"