-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
171 lines (164 loc) · 4.55 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
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
version: "3.7"
services:
wpv1-nginx-service:
container_name: wpv1-nginx
image: 127.0.0.1:5000/wpv1-nginx-image
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
args:
WORDPRESS_DIR: ${WORDPRESS_DIR}
SHARED_USER: ${SHARED_USER}
SHARED_GROUP: ${SHARED_GROUP}
SHARED_UID: ${SHARED_UID}
SHARED_GID: ${SHARED_GID}
HTTPS: ${HTTPS}
FORWARDED_HTTP_PORT: ${FORWARDED_HTTP_PORT}
FORWARDED_HTTPS_PORT: ${FORWARDED_HTTPS_PORT}
PHPFPM_PORT: ${PHPFPM_PORT}
PHPFPM_SERVICE_NAME: ${PHPFPM_SERVICE_NAME}
working_dir: ${WORDPRESS_DIR}
ports:
- "${HTTPS_PORT}:${FORWARDED_HTTPS_PORT}"
- "${HTTP_PORT}:${FORWARDED_HTTP_PORT}"
volumes:
- wpv1-nfs-nginx-logs-volume:/var/log/nginx
- wpv1-nfs-app-volume:/${WORDPRESS_DIR}
- ./docker/nginx/certs:/etc/nginx/ssl/certs
depends_on:
wpv1-php-service:
condition: service_started
networks:
- wpv1-network
healthcheck:
test:
[
"CMD-SHELL",
"ps -u ${SHARED_UID} | grep nginx || exit 1"
]
wpv1-php-service:
container_name: wpv1-php
image: 127.0.0.1:5000/wpv1-php-image
build:
context: .
dockerfile: ./docker/php/Dockerfile
args:
WORDPRESS_DIR: ${WORDPRESS_DIR}
SHARED_USER: ${SHARED_USER}
SHARED_GROUP: ${SHARED_GROUP}
SHARED_UID: ${SHARED_UID}
SHARED_GID: ${SHARED_GID}
DEBUG: ${DEBUG}
PHPFPM_MAX_CHILDREN: ${PHPFPM_MAX_CHILDREN}
PHPFPM_PM: ${PHPFPM_PM}
PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT}
PHP_MAX_EXECUTION_TIME: ${PHP_MAX_EXECUTION_TIME}
PHP_UPLOAD_MAX_FILESIZE: ${PHP_UPLOAD_MAX_FILESIZE}
PHP_POST_MAX_SIZE: ${PHP_POST_MAX_SIZE}
PHP_MAX_INPUT_TIME: ${PHP_MAX_INPUT_TIME}
working_dir: ${WORDPRESS_DIR}
volumes:
- wpv1-nfs-app-volume:${WORDPRESS_DIR}
depends_on:
- wpv1-mariadb-service
networks:
- wpv1-network
healthcheck:
test: [ "CMD-SHELL", "ps -u ${SHARED_UID} | grep fpm || exit 1" ]
wpv1-mariadb-service:
container_name: wpv1-mariadb
image: 127.0.0.1:5000/wpv1-mariadb-image
build:
context: .
dockerfile: ./docker/database/Dockerfile
user: root
volumes:
- wpv1-nfs-mariadb-volume:/var/lib/mysql
- wpv1-nfs-mariadb-logs-volume:/var/log/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${WORDPRESS_DB_USER}
MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD}
MYSQL_DATABASE: ${WORDPRESS_DB_NAME}
expose:
- "3306"
ports:
- "3306:3306"
networks:
- wpv1-network
healthcheck:
test:
[
"CMD-SHELL",
"healthcheck.sh --su-mysql --connect --innodb_initialized || exit 1"
]
wpv1-phpmyadmin-service:
container_name: wpv1-phpmyadmin
image: 127.0.0.1:5000/wpv1-phpmyadmin-image
build:
context: .
dockerfile: ./docker/phpmyadmin/Dockerfile
depends_on:
- wpv1-mariadb-service
ports:
- ${PHPMYADMIN_PORT}:80
environment:
MYSQL_USERNAME: ${MYSQL_ROOT}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
PMA_HOST: ${WORDPRESS_DB_HOST}
PMA_ARBITRARY: 1
networks:
- wpv1-network
wpv1-wpcli-service:
container_name: wpv1-wpcli
image: 127.0.0.1:5000/wpv1-wpcli-image
build:
context: .
dockerfile: ./docker/wp-cli/Dockerfile
args:
WORDPRESS_DIR: ${WORDPRESS_DIR}
SHARED_USER: ${SHARED_USER}
SHARED_GROUP: ${SHARED_GROUP}
SHARED_UID: ${SHARED_UID}
SHARED_GID: ${SHARED_GID}
working_dir: $WORDPRESS_DIR
volumes:
- wpv1-nfs-app-volume:${WORDPRESS_DIR}
- ./docker/.env:/.env
- ./docker/wp-cli/entrypoint.sh:/entrypoint
depends_on:
wpv1-mariadb-service:
condition: service_healthy
wpv1-php-service:
condition: service_healthy
networks:
- wpv1-network
entrypoint: [ "/bin/bash", "/entrypoint" ]
networks:
wpv1-network:
driver: bridge
volumes:
wpv1-nfs-app-volume:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./wordpress"
wpv1-nfs-nginx-logs-volume:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./logs/nginx"
wpv1-nfs-mariadb-logs-volume:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./mariadb/logs"
wpv1-nfs-mariadb-volume:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./mariadb/data"