-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (72 loc) 路 2.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (72 loc) 路 2.5 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
services:
db:
image: mysql:8.0
# Remove container_name to allow multiple instances
volumes:
- ${INSTANCE_PATH}/db_data:/var/lib/mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
MYSQL_DATABASE: ${MYSQL_DATABASE:-wordpress}
MYSQL_USER: ${MYSQL_USER:-wordpress}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-wordpress}
networks:
- default
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-rootpassword}" ]
timeout: 20s
retries: 10
wordpress:
build:
context: .
dockerfile: Dockerfile
args:
WORDPRESS_VERSION: ${WORDPRESS_VERSION:-6.4}
PHP_VERSION: ${PHP_VERSION:-8.1}
WORDPRESS_IMAGE: ${WORDPRESS_IMAGE}
depends_on:
db:
condition: service_healthy
ports:
- "${WORDPRESS_PORT:-8000}:80"
- "${WORDPRESS_SSL_PORT:-8443}:443"
volumes:
# Mount instance-specific WordPress directory
- ${INSTANCE_PATH}/wordpress:/var/www/html
# Mount shared plugins
- ${PLUGINS_PATH}:/var/www/html/wp-content/plugins/shared-plugins
- ./scripts:/var/www/scripts
# Mount SSL certificates (global for now, or per instance if needed)
- ./ssl/cert.pem:/etc/ssl/certs/cert.pem:ro
- ./ssl/key.pem:/etc/ssl/private/key.pem:ro
restart: unless-stopped
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: ${MYSQL_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD:-wordpress}
WORDPRESS_DB_NAME: ${MYSQL_DATABASE:-wordpress}
WORDPRESS_DEBUG: ${WORDPRESS_DEBUG:-1}
WORDPRESS_DEBUG_LOG: ${WORDPRESS_DEBUG_LOG:-1}
WORDPRESS_DEBUG_DISPLAY: ${WORDPRESS_DEBUG_DISPLAY:-0}
WORDPRESS_CONFIG_EXTRA: |
define('WP_ENVIRONMENT_TYPE', 'local');
define('SCRIPT_DEBUG', true);
define('SAVEQUERIES', true);
XDEBUG_MODE: ${XDEBUG_MODE:-debug}
XDEBUG_CONFIG: client_host=${XDEBUG_CLIENT_HOST:-host.docker.internal} client_port=${XDEBUG_CLIENT_PORT:-9003} idekey=${XDEBUG_IDE_KEY:-PHPSTORM}
PHP_IDE_CONFIG: serverName=${WORDPRESS_HOSTNAME:-localhost}
extra_hosts:
- "host.docker.internal:host-gateway"
phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
- db
ports:
- "${PMA_PORT:-8080}:80"
environment:
PMA_HOST: db
PMA_PORT: 3306
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
networks:
default:
driver: bridge