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 1
/
docker-compose.yml
114 lines (114 loc) · 3.21 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
# ------------------------------------------------------------------------------
# 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
#
# Check service logs:
# docker-compose logs -f -t varnish
#
# Usage:
# docker-compose exec varnish varnishadm
# docker-compose exec varnish varnishadm ban "req.url ~ (\\\.css|\\\.js)"
# docker-compose exec varnish varnishadm ban "req.url ~ ."
# docker-compose exec varnish varnishadm ban.list
# docker-compose exec varnish varnishlog -c -q 'ReqURL ~ "/$"'
# ------------------------------------------------------------------------------
version: "3.0"
networks:
tier1:
driver: "bridge"
tier2:
driver: "bridge"
internal: true
services:
varnish:
build:
context: "."
dockerfile: "Dockerfile"
depends_on:
- "apache-php"
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: "${VARNISH_VCL_CONF}"
image: "jdeathe/centos-ssh-varnish:latest"
networks:
- "tier1"
- "tier2"
ports:
# HTTP protocol
- "8000:80"
# PROXY protocol
- "8500:8443"
restart: "always"
sysctls:
net.core.somaxconn: "1024"
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
apache-php:
depends_on:
- "redis"
environment:
APACHE_CUSTOM_LOG_LOCATION: "/dev/null"
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:
tier2:
aliases:
- "httpd_1"
restart: "always"
sysctls:
net.core.somaxconn: "1024"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
redis:
environment:
REDIS_MAXMEMORY: "32mb"
REDIS_TCP_BACKLOG: "1024"
SYSTEM_TIMEZONE: "${SYSTEM_TIMEZONE}"
image: "jdeathe/centos-ssh-redis:4.1.1"
networks:
- "tier2"
ports:
- "6379:6379"
restart: "always"
sysctls:
net.core.somaxconn: "1024"
net.ipv4.ip_local_port_range: "1024 65535"
net.ipv4.route.flush: "1"
ulimits:
memlock: 82000
nofile:
soft: 524288
hard: 1048576
nproc: 65535