-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
130 lines (119 loc) · 4.08 KB
/
Copy pathcompose.yml
File metadata and controls
130 lines (119 loc) · 4.08 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
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
# Podman-compatible local development environment for lrmd-theme
# Requirements: podman, podman-compose
#
# Usage:
# podman-compose up -d
# Wait ~60 s for the setup service to finish, then open:
# Site: http://localhost:8081
# Admin: http://localhost:8081/wp-admin (admin / admin)
#
# Teardown (removes all data):
# podman-compose down -v
#
# Note: the lrmd-theme/ directory must exist before running this file.
# It is created as part of Phase 1 of the implementation plan.
# If the theme directory is absent the setup service will print a warning
# and skip theme activation — activate manually in WP Admin once Phase 1
# files are in place.
#
# WordPress image tag: 6.9.4-php8.2-apache
# If this exact tag is not yet published on Docker Hub, replace it with
# the nearest available tag: wordpress:6-php8.2-apache
services:
db:
image: docker.io/library/mariadb:10.11
environment:
MARIADB_ROOT_PASSWORD: rootpass
MARIADB_DATABASE: wordpress
MARIADB_USER: wordpress
MARIADB_PASSWORD: wordpress
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
wordpress:
image: docker.io/library/wordpress:6.9.4-php8.2-apache
depends_on:
db:
condition: service_healthy
ports:
- "8081:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- ./wp-data:/var/www/html:z
- ./lrmd-theme:/var/www/html/wp-content/themes/lrmd-theme:z
# Wrap the upstream entrypoint as PID 1 to swallow SIGWINCH that
# podman-compose forwards from its controlling TTY — apache treats
# SIGWINCH as graceful-stop and would log AH00170 / exit while idle.
# SIGTERM/SIGINT are still forwarded to apache for clean shutdown.
entrypoint:
- sh
- -c
- |
trap '' WINCH
docker-entrypoint.sh apache2-foreground &
pid=$$!
trap 'kill -TERM $$pid 2>/dev/null' TERM INT
wait $$pid
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost/wp-includes/version.php"]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s
setup:
image: docker.io/library/wordpress:cli-php8.2
user: '33'
restart: "no"
depends_on:
wordpress:
condition: service_healthy
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- ./wp-data:/var/www/html:z
- ./lrmd-theme:/var/www/html/wp-content/themes/lrmd-theme:z
- ./compose-scripts:/scripts:ro,z
command:
- sh
- -c
- |
set -e
if ! wp core is-installed --allow-root 2>/dev/null; then
wp core install \
--url=http://192.168.1.252:8081 \
--title='LRMD' \
--admin_user=admin \
--admin_password=admin \
--admin_email=admin@lrmd.local \
--skip-email \
--allow-root
fi
wp plugin install polylang --activate --allow-root
wp plugin install gdpr-cookie-compliance --activate --allow-root
# Polylang free does not register `wp pll`; bootstrap LT + EN via PHP API.
wp eval-file /scripts/setup-polylang.php --allow-root
wp option set blogdescription 'Lietuvos radijo mėgėjų draugija' --allow-root
wp rewrite structure '/%year%/%postname%/' --allow-root
wp rewrite flush --allow-root
if wp theme is-installed lrmd-theme --allow-root 2>/dev/null; then
wp theme activate lrmd-theme --allow-root
# Test data (sample pages, posts, menus). Idempotent — safe to re-run.
# Edit compose-scripts/seed-test-data.sh to change seeded content.
sh /scripts/seed-test-data.sh
else
echo "lrmd-theme not yet available — activate manually after Phase 1."
fi
volumes:
db_data: