-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (87 loc) · 2.31 KB
/
docker-compose.yml
File metadata and controls
96 lines (87 loc) · 2.31 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
services:
# MySQL Service
db:
image: mysql:5.7
platform: linux/amd64
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- wordpress_net
# Health check
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 5
interval: 5s
# WordPress Service
wordpress:
build:
context: .
dockerfile: Dockerfile
platform: linux/amd64
image: wp-wordpress
depends_on:
db:
condition: service_healthy
ports:
- "8080:80"
restart: always
volumes:
- wp_data:/var/www/html
# Use conditional mounting for wp-content
- ${PWD}/wp-content:/var/www/html/wp-content:delegated
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_SITE_URL: http://localhost:8080
WORDPRESS_SITE_TITLE: Jerry's WordPress Dev
WORDPRESS_ADMIN_USER: jerry
WORDPRESS_ADMIN_PASSWORD: garcia
WORDPRESS_ADMIN_EMAIL: admin@example.com
networks:
- wordpress_net
# Simplified startup command
entrypoint: ["/bin/bash", "-c"]
command:
- |
# Fix any potential line ending issues
dos2unix /usr/local/bin/wp-installer.sh 2>/dev/null || true
# Start Apache in background
apache2-foreground &
# Wait a moment for Apache to start
sleep 5
# Fix wp-content permissions for Windows/WSL
chown -R www-data:www-data /var/www/html/wp-content 2>/dev/null || true
chmod -R 755 /var/www/html/wp-content 2>/dev/null || true
# Run our installer script
/usr/local/bin/wp-installer.sh
# Keep Apache running
wait $!
# phpMyAdmin Service
phpmyadmin:
image: phpmyadmin:latest
container_name: wp-test-phpmyadmin-8080
ports:
- "8180:80"
environment:
PMA_HOST: db
PMA_USER: wordpress
PMA_PASSWORD: wordpress
PMA_DB: wordpress
depends_on:
- db
networks:
- wordpress_net
networks:
wordpress_net:
volumes:
db_data:
wp_data: