-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.apache.yaml
More file actions
164 lines (160 loc) · 4.46 KB
/
compose.apache.yaml
File metadata and controls
164 lines (160 loc) · 4.46 KB
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
services:
wordpress:
build:
context: .
dockerfile: Dockerfile.apache
restart: unless-stopped
deploy:
resources:
limits:
cpus: "${WP_CPU_LIMIT:-2.0}"
memory: "${WP_MEMORY_LIMIT:-2048M}"
reservations:
cpus: "${WP_CPU_RESERVATION:-0.5}"
memory: "${WP_MEMORY_RESERVATION:-512M}"
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
- CHOWN
- SETUID
- SETGID
- DAC_OVERRIDE
- FOWNER
expose:
- "80"
volumes:
- "wordpress-files:/var/www/html"
environment:
- WORDPRESS_DB_HOST=mariadb
- WORDPRESS_DB_USER=${SERVICE_USER_WORDPRESS}
- WORDPRESS_DB_PASSWORD=${SERVICE_PASSWORD_WORDPRESS}
- WORDPRESS_DB_NAME=wordpress
- SERVICE_PASSWORD_REDIS=${SERVICE_PASSWORD_REDIS}
- FLUSH_REDIS_ON_STARTUP=${FLUSH_REDIS_ON_STARTUP:-false}
- WORDPRESS_CONFIG_EXTRA=
define('WP_MAX_MEMORY_LIMIT', '512M');
define('DISABLE_WP_CRON', true);
define('ACTION_SCHEDULER_MAX_EXECUTION_TIME', 60);
define('ACTION_SCHEDULER_BATCH_SIZE', 10);
define('WP_REDIS_HOST', 'redis');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_PASSWORD', getenv('SERVICE_PASSWORD_REDIS'));
define('WP_REDIS_TIMEOUT', 1);
define('WP_REDIS_READ_TIMEOUT', 1);
define('WP_REDIS_IGBINARY', true);
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
networks:
- wordpress-network
- backend
healthcheck:
test: ["CMD", "curl", "-f", "-m", "8", "http://127.0.0.1/wp-includes/images/blank.gif"]
interval: 10s
timeout: 10s
retries: 10
start_period: 90s
logging:
driver: "json-file"
options:
max-size: "${LOG_MAX_SIZE:-10m}"
max-file: "${LOG_MAX_FILES:-3}"
labels: "service=wordpress"
mariadb:
image: "mariadb:11"
restart: unless-stopped
deploy:
resources:
limits:
cpus: "${DB_CPU_LIMIT:-1.0}"
memory: "${DB_MEMORY_LIMIT:-1024M}"
reservations:
cpus: "${DB_CPU_RESERVATION:-0.25}"
memory: "${DB_MEMORY_RESERVATION:-256M}"
cap_drop:
- ALL
cap_add:
- CHOWN
- SETUID
- SETGID
- DAC_OVERRIDE
command: >
--skip-log-bin
--max_allowed_packet=${DB_MAX_ALLOWED_PACKET:-67108864}
--innodb_buffer_pool_size=${DB_INNODB_BUFFER_POOL:-536870912}
--max_connections=${DB_MAX_CONNECTIONS:-500}
--connect_timeout=10
--wait_timeout=${DB_WAIT_TIMEOUT:-300}
--interactive_timeout=${DB_WAIT_TIMEOUT:-300}
--slow_query_log=1
--slow_query_log_file=/var/lib/mysql/slow.log
--long_query_time=${DB_SLOW_QUERY_TIME:-2}
volumes:
- "mariadb-data:/var/lib/mysql"
environment:
- MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_ROOT}
- MYSQL_DATABASE=wordpress
- MYSQL_USER=${SERVICE_USER_WORDPRESS}
- MYSQL_PASSWORD=${SERVICE_PASSWORD_WORDPRESS}
networks:
- wordpress-network
- backend
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 20s
retries: 10
logging:
driver: "json-file"
options:
max-size: "${LOG_MAX_SIZE:-10m}"
max-file: "${LOG_MAX_FILES:-3}"
labels: "service=mariadb"
redis:
image: "redis:7-alpine"
restart: unless-stopped
deploy:
resources:
limits:
cpus: "${REDIS_CPU_LIMIT:-0.5}"
memory: "${REDIS_MEMORY_LIMIT:-512M}"
cap_drop:
- ALL
command: >
redis-server
--requirepass ${SERVICE_PASSWORD_REDIS}
--maxmemory ${REDIS_MEMORY_LIMIT:-512M}
--maxmemory-policy ${REDIS_MAX_MEMORY_POLICY:-allkeys-lru}
--save ""
--appendonly yes
--appendfsync everysec
volumes:
- "redis-data:/data"
networks:
- wordpress-network
- backend
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${SERVICE_PASSWORD_REDIS} ping | grep PONG"]
interval: 10s
timeout: 10s
retries: 5
start_period: 5s
logging:
driver: "json-file"
options:
max-size: "${LOG_MAX_SIZE:-10m}"
max-file: "${LOG_MAX_FILES:-3}"
labels: "service=redis"
networks:
wordpress-network:
driver: bridge
backend:
driver: bridge
internal: true
volumes:
wordpress-files:
mariadb-data:
redis-data: