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.yml
137 lines (137 loc) · 3.92 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
# ------------------------------------------------------------------------------
# Ref: https://docs.docker.com/compose/compose-file/
#
# Setup:
# Copy .env.example to .env and modify values as required.
# docker-compose down
# docker-compose build
#
# Run Default example:
# docker-compose 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
# ------------------------------------------------------------------------------
version: "3.0"
networks:
tier1:
driver: "bridge"
tier3:
driver: "bridge"
internal: true
tier4:
driver: "bridge"
internal: true
services:
haproxy:
build:
context: "."
dockerfile: "Dockerfile"
environment:
HAPROXY_CONFIG: "${HAPROXY_CONFIG}"
HAPROXY_HOST_NAMES: "${HAPROXY_HOST_NAMES}"
HAPROXY_SSL_CERTIFICATE: "${HAPROXY_SSL_CERTIFICATE}"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
image: "jdeathe/centos-ssh-haproxy:latest"
networks:
- "tier1"
- "tier3"
ports:
- "80:80"
- "443:443"
restart: "always"
sysctls:
net.core.somaxconn: "32768"
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
# On CentOS-7 ${PWD} appears to get unset when running docker-compose.
# Fail back with the "." value for the working directory.
- "${PWD:-.}/test/fixture/secrets:/var/run/secrets:ro"
apache-php1:
depends_on:
- "redis"
environment:
APACHE_CUSTOM_LOG_LOCATION: "/dev/stdout"
APACHE_ERROR_LOG_LOCATION: "/dev/stderr"
APACHE_LOAD_MODULES: "rewrite_module"
APACHE_MOD_SSL_ENABLED: "false"
APACHE_MPM: "event"
APACHE_SERVER_ALIAS: "app.local"
APACHE_SERVER_NAME: "www.app.local"
PHP_OPTIONS_DATE_TIMEZONE: "${SYSTEM_TIMEZONE}"
PHP_OPTIONS_SESSION_SAVE_HANDLER: "redis"
PHP_OPTIONS_SESSION_SAVE_PATH: "redis:6379"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
image: "jdeathe/centos-ssh-apache-php:3.3.3"
networks:
tier3:
aliases:
- "apache-php.1"
- "httpd_1"
tier4:
restart: "always"
sysctls:
net.core.somaxconn: "2048"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
apache-php2:
depends_on:
- "redis"
environment:
APACHE_CUSTOM_LOG_LOCATION: "/dev/stdout"
APACHE_ERROR_LOG_LOCATION: "/dev/stderr"
APACHE_LOAD_MODULES: "rewrite_module"
APACHE_MOD_SSL_ENABLED: "false"
APACHE_MPM: "event"
APACHE_SERVER_ALIAS: "app.local"
APACHE_SERVER_NAME: "www.app.local"
PHP_OPTIONS_DATE_TIMEZONE: "${SYSTEM_TIMEZONE}"
PHP_OPTIONS_SESSION_SAVE_HANDLER: "redis"
PHP_OPTIONS_SESSION_SAVE_PATH: "redis:6379"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
image: "jdeathe/centos-ssh-apache-php:3.3.3"
networks:
tier3:
aliases:
- "apache-php.2"
- "httpd_2"
tier4:
restart: "always"
sysctls:
net.core.somaxconn: "2048"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
redis:
environment:
REDIS_MAXMEMORY: "32mb"
REDIS_TCP_BACKLOG: "2048"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
image: "jdeathe/centos-ssh-redis:4.1.1"
networks:
- "tier4"
ports:
- "6379:6379"
restart: "always"
sysctls:
net.core.somaxconn: "2048"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
ulimits:
memlock: 82000
nofile:
soft: 524288
hard: 1048576
nproc: 65535