-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
114 lines (109 loc) · 3.25 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
version: '3.4'
services:
wp_dev:
build:
context: ./
dockerfile: docker/Dockerfile_wp
target: dev
args:
PHP_BUILD_VERSION: $PHP_BUILD_VERSION
PHP_TEST_VERSION: $PHP_TEST_VERSION
PHP_MEMORY_LIMIT: $PHP_MEMORY_LIMIT
WORDPRESS_VERSION: $WORDPRESS_VERSION
NODE_VERSION: $NODE_VERSION
PROJECT_MOUNT_PATH: $PROJECT_MOUNT_PATH
BUILD_ROOT_PATH: $BUILD_ROOT_PATH
DOCROOT_PATH: $DOCROOT_PATH
WP_DOMAIN: ${WP_DOMAIN}
container_name: "${PROJECT_NAME}_wp_dev"
depends_on:
- db
restart: unless-stopped
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_NAME: $DB_NAME
WORDPRESS_DB_USER: $DB_USER_NAME
WORDPRESS_DB_PASSWORD: $DB_USER_PASSWORD
WORDPRESS_DEBUG: 1
DOCROOT_PATH: ${DOCROOT_PATH}
PLUGIN_NAME: ${PLUGIN_NAME}
ADMIN_USER: ${ADMIN_USER}
ADMIN_PASS: ${ADMIN_PASS}
ADMIN_EMAIL: ${ADMIN_EMAIL}
WP_DOMAIN: ${WP_DOMAIN}
WP_TITLE: ${WP_TITLE}
volumes:
- ${BASE_PATH}:${PROJECT_MOUNT_PATH}
- type: bind
source: ./wordpress
target: "${DOCROOT_PATH}"
# This is just a guard that aborts if the mount folder for the plugin doesn't exist.
# This keeps Docker from creating a root-owned folder in the host file system.
# This only works with the long form mount definition. Only missing `source` causes an error.
# https://docs.docker.com/storage/bind-mounts/#differences-between--v-and---mount-behavior
- type: bind
source: "./wordpress/wp-content/plugins/${PLUGIN_NAME}"
target: /tmp/foo
ports:
- 80:80
db:
image: mariadb:latest
container_name: "${PROJECT_NAME}_db"
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER_NAME
MYSQL_PASSWORD: $DB_USER_PASSWORD
ports:
- 3306:3306
volumes:
- db:/var/lib/mysql
db_admin:
image: phpmyadmin/phpmyadmin:latest
container_name: "${PROJECT_NAME}_db_admin"
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
depends_on:
- db
ports:
- 1234:80
# volumes:
# - db_admin
build:
build:
context: ./
dockerfile: docker/Dockerfile_wp
target: build
args:
PHP_BUILD_VERSION: $PHP_BUILD_VERSION
PHP_TEST_VERSION: $PHP_TEST_VERSION
WORDPRESS_VERSION: $WORDPRESS_VERSION
NODE_VERSION: $NODE_VERSION
BUILD_ROOT_PATH: $BUILD_ROOT_PATH
PHP_MEMORY_LIMIT: $PHP_MEMORY_LIMIT
container_name: "${PROJECT_NAME}_build"
working_dir: ${BUILD_ROOT_PATH}
volumes:
- ${BASE_PATH}:${BUILD_ROOT_PATH}
test:
build:
context: ./
dockerfile: docker/Dockerfile_wp
target: test
args:
BUILD_ROOT_PATH: $BUILD_ROOT_PATH
PHP_BUILD_VERSION: $PHP_BUILD_VERSION
PHP_TEST_VERSION: $PHP_TEST_VERSION
WORDPRESS_VERSION: $WORDPRESS_VERSION
NODE_VERSION: $NODE_VERSION
PHP_MEMORY_LIMIT: $PHP_MEMORY_LIMIT
container_name: "${PROJECT_NAME}_test"
working_dir: ${BUILD_ROOT_PATH}
volumes:
- ${BASE_PATH}:${BUILD_ROOT_PATH}
volumes:
wordpress:
db:
db_admin: