-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
181 lines (175 loc) · 5.36 KB
/
docker-compose.yml
File metadata and controls
181 lines (175 loc) · 5.36 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# to override the environment, you can configure environment variables in a .env file saved in this directory.
# the following environment variables are supported:
# - PHP_VERSION - defaults to 8.1, must be a version that has an official docker container available
# - BACKEND - 'mariadb' or 'mysql', defaults to 'mariadb'
# - WORDPRESS_VERSION - defaults to latest (defined below)
# - PORT - the port to expose wordpress on, defaults to 3000
# - WP_ADMIN_USER - the admin wordpress username, defaults to 'root'
# - WP_ADMIN_EMAIL - the admin user's email, defaults to 'nobody@nowhere.local'
# - WOOCOMMERCE - if set, installs and sets up woocommerce
# - MULTISITE - if set to '1', creates a multisite wordpress install. the folder will be suffixed with '-multi'
services:
# basic apache service
wordpress:
env_file:
- .env.default
- .env
- ${CUSTOM_ENV_FILE:-/dev/null}
build:
context: ./scripts
dockerfile: ./Dockerfile.local
args:
BASE_IMAGE: "${BASE_IMAGE:-php:$PHP_VERSION-apache}"
environment:
RUN_AS_USER: "${UID:-1000}"
volumes:
- ./docker/wordpress:$DOCUMENT_ROOT
- .:$DOCUMENT_ROOT/matomo-for-wordpress
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh
- ./docker/wp-cli:/.wp-cli
- ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini
- ./scripts/local-gitconfig:/root/.gitconfig
ports:
- "$PORT:$PORT"
entrypoint: /usr/src/entrypoint.sh
depends_on:
- $BACKEND
- mailer
extra_hosts:
- "host.docker.internal:host-gateway"
# nginx service
fpm:
env_file:
- .env.default
- .env
- ${CUSTOM_ENV_FILE:-/dev/null}
build:
context: .
dockerfile: ./scripts/Dockerfile.local
args:
BASE_IMAGE: "${BASE_IMAGE:-php:$PHP_VERSION-fpm}"
volumes:
- ./docker/wordpress:$DOCUMENT_ROOT
- .:$DOCUMENT_ROOT/matomo-for-wordpress
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh
- ./docker/wp-cli:/.wp-cli
- ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini
- ./scripts/local-gitconfig:/.gitconfig
entrypoint: /usr/src/entrypoint.sh
depends_on:
- "$BACKEND"
nginx:
image: nginx
volumes:
- ./scripts/local-dev-nginx.conf:/etc/nginx/conf.d/default.conf
- ./docker/wordpress:$DOCUMENT_ROOT
- .:$DOCUMENT_ROOT/matomo-for-wordpress
depends_on:
- fpm
ports:
- "$PORT:80"
deploy:
restart_policy:
condition: on-failure
# litespeed enterprise (requires license)
litespeed:
env_file:
- .env.default
- .env
- ${CUSTOM_ENV_FILE:-/dev/null}
build:
context: ./scripts
dockerfile: ./Dockerfile.local
args:
BASE_IMAGE: litespeedtech/litespeed:6.3.2-lsphp81
ulimits:
nofile:
soft: 50000
hard: 50000
nproc: 65535
deploy:
resources:
limits:
memory: 1G
environment:
RUN_AS_USER: "${UID:-1000}"
DOCUMENT_ROOT: /var/www/vhosts/localhost/html
volumes:
- ./docker/wordpress:/var/www/vhosts/localhost/html
- .:/var/www/vhosts/localhost/html/matomo-for-wordpress
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh
- ./docker/wp-cli:/.wp-cli
- ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini
- ./scripts/local-gitconfig:/root/.gitconfig
- ./serial.no:/serial.no
ports:
- "$PORT:$PORT"
entrypoint: /usr/src/entrypoint.sh
depends_on:
- $BACKEND
- mailer
extra_hosts:
- "host.docker.internal:host-gateway"
# service for running CLI utilities including wp-cli, the matomo console and phpunit
exec:
env_file:
- .env.default
- .env
- ${CUSTOM_ENV_FILE:-/dev/null}
build:
context: ./scripts
dockerfile: ./Dockerfile.local
args:
BASE_IMAGE: "${BASE_IMAGE:-php:$PHP_VERSION-apache}"
volumes:
- ./docker/wordpress:$DOCUMENT_ROOT
- .:$DOCUMENT_ROOT/matomo-for-wordpress
- ./docker/wp-cli:/.wp-cli
- ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh
- ./scripts/local-gitconfig:/.gitconfig
ports:
- "$PORT:80"
user: "${UID:-1000}:${GID:-1000}"
entrypoint: /usr/src/entrypoint.sh
environment:
EXECUTE_CLI: 1
depends_on:
- "$BACKEND"
extra_hosts:
- "host.docker.internal:host-gateway"
# database service definitions
mariadb:
image: mariadb:lts
environment:
MYSQL_ROOT_PASSWORD: pass
volumes:
- ./docker/mariadb:/var/lib/mysql:delegated
- ./docker/maria_custom_my.cnf:/etc/mysql/conf.d/mycustom.cnf
deploy:
restart_policy:
condition: on-failure
mysql:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: pass
volumes:
- ./docker/mysql:/var/lib/mysql:delegated
- ./docker/container-files/mysql_custom_my.cnf:/etc/mysql/conf.d/mycustom.cnf
ports:
- "3307:3306"
deploy:
restart_policy:
condition: on-failure
mailer:
image: axllent/mailpit
deploy:
restart_policy:
condition: on-failure
volumes:
- ./docker/mailer:/data
ports:
- 8025:8025
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1