-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathdocker-compose.yml
110 lines (102 loc) · 3.91 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
version: "3.3"
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
ports:
- "53306:3306"
volumes:
# - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
- wpdb:/var/lib/mysql # I want to manage volumes manually.
php:
image: wodby/wordpress-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
DB_HOST: $DB_HOST
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
PHP_FPM_USER: wodby
PHP_FPM_GROUP: wodby
## Read instructions at https://wodby.com/stacks/wordpress/docs/local/xdebug/
PHP_XDEBUG: 0
PHP_XDEBUG_DEFAULT_ENABLE: 0
PHP_XDEBUG_REMOTE_AUTOSTART: 0
PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
PHP_XDEBUG_IDEKEY: ${XDEBUG_IDE_KEY}
PHP_IDE_CONFIG: serverName=${XDEBUG_SERVER_NAME}
PHP_XDEBUG_REMOTE_HOST: ${XDEBUG_REMOTE_HOST}
volumes:
- ${BASE_DIR}/docker/.htaccess:${DOCROOT}/.htaccess
- ${BASE_DIR}/docker/wp-install.sh:/opt/wp-install.sh
- ${BASE_DIR}/vendor/johnpbloch/wordpress-core:${DOCROOT}
- ${BASE_DIR}:${PROJECT_MOUNT_PATH}
- ${BASE_DIR}/vendor/woocommerce/woocommerce:${DOCROOT}/wp-content/plugins/woocommerce
- ${BASE_DIR}/vendor/woocommerce/woocommerce-blocks:${DOCROOT}/wp-content/plugins/woocommerce-blocks
- ${BASE_DIR}/vendor/woocommerce/woocommerce-rest-api:${DOCROOT}/wp-content/plugins/woocommerce-rest-api
composer:
image: composer:1.9.1
container_name: "${PROJECT_NAME}_composer"
working_dir: ${PROJECT_MOUNT_PATH}
volumes:
- ${BASE_DIR}:${PROJECT_MOUNT_PATH}
nginx:
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_nginx"
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_VHOST_PRESET: wordpress
#NGINX_SERVER_ROOT: /var/www/html/subdir
volumes:
- ${BASE_DIR}/docker/.htaccess:${DOCROOT}/.htaccess
- ${BASE_DIR}/vendor/johnpbloch/wordpress-core:${DOCROOT}
- ${BASE_DIR}:${PROJECT_MOUNT_PATH}
- ${BASE_DIR}/vendor/woocommerce/woocommerce:${DOCROOT}/wp-content/plugins/woocommerce
- ${BASE_DIR}/vendor/woocommerce/woocommerce-blocks:${DOCROOT}/wp-content/plugins/woocommerce-blocks
- ${BASE_DIR}/vendor/woocommerce/woocommerce-rest-api:${DOCROOT}/wp-content/plugins/woocommerce-rest-api
# Options for macOS users (https://wodby.com/stacks/wordpress/docs/local/docker-for-mac/)
# - ./:/var/www/html:cached # User-guided caching
# - docker-sync:/var/www/html # Docker-sync
labels:
- "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"
mailhog:
image: mailhog/mailhog
container_name: "${PROJECT_NAME}_mailhog"
labels:
- "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
- "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(`mailhog.${PROJECT_BASE_URL}`)"
portainer:
image: portainer/portainer
container_name: "${PROJECT_NAME}_portainer"
command: --no-auth -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.http.routers.${PROJECT_NAME}_portainer.rule=Host(`portainer.${PROJECT_BASE_URL}`)"
traefik:
image: traefik:v2.0
container_name: "${PROJECT_NAME}_traefik"
command: --api.insecure=true --providers.docker
ports:
- '80:80'
# - '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
## Docker-sync for macOS users
# docker-sync:
# external: true
## For Xdebug profiler
# files:
wpdb: