-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
docker-compose.yml
143 lines (138 loc) · 4.19 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
138
139
140
141
142
143
# 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 '[email protected]'
# - 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
build:
context: ./scripts
dockerfile: ./Dockerfile.local
args:
PHP_VERSION: "$PHP_VERSION"
PHP_TYPE: apache
environment:
RUN_AS_USER: "${UID:-1000}"
volumes:
- ./docker/wordpress:/var/www/html
- .:/var/www/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
ports:
- "$PORT:$PORT"
entrypoint: /usr/src/entrypoint.sh
depends_on:
- $BACKEND
- mailer
deploy:
restart_policy:
condition: on-failure
extra_hosts:
- "host.docker.internal:host-gateway"
# nginx service
fpm:
env_file:
- .env.default
- .env
build:
context: .
dockerfile: ./scripts/Dockerfile.local
args:
PHP_VERSION: "$PHP_VERSION"
PHP_TYPE: fpm
volumes:
- ./docker/wordpress:/var/www/html
- .:/var/www/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:/.gitconfig
entrypoint: /usr/src/entrypoint.sh
depends_on:
- "$BACKEND"
deploy:
restart_policy:
condition: on-failure
nginx:
image: nginx
volumes:
- ./scripts/local-dev-nginx.conf:/etc/nginx/conf.d/default.conf
- ./docker/wordpress:/var/www/html
- .:/var/www/html/matomo-for-wordpress
depends_on:
- fpm
ports:
- "$PORT:80"
deploy:
restart_policy:
condition: on-failure
# service for running CLI utilities including wp-cli, the matomo console and phpunit
exec:
env_file:
- .env.default
- .env
build:
context: ./scripts
dockerfile: ./Dockerfile.local
args:
PHP_VERSION: "$PHP_VERSION"
PHP_TYPE: apache
volumes:
- ./docker/wordpress:/var/www/html
- .:/var/www/html/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"
# 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
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