Project

General

Profile

WordPress » History » Version 4

Redmine Admin, 10/31/2026 07:01 PM
deploy-publish.sh

1 4 Redmine Admin
*Chapter 2 of the dmz-web documentation · headings are numbered like the cheat sheets · index: [[Wiki]]*
2
3 2 Redmine Admin
Created by `~/deploy/add-wordpress-site.sh <domain> [short-name] [--no-egress] [--force] [--skip-npm-api]`.
4 1 Redmine Admin
Short name derives from the domain (`www.mdsdefense.com` → `mdsdefense`).
5
6
Per site:
7
8 2 Redmine Admin
| Object        | Name                      | Notes                                      |
9
|---------------|---------------------------|--------------------------------------------|
10
| Network       | `net-<name>`              | `net-<name>.network`                       |
11
| MariaDB       | `db-<name>`               | `mariadb:11`, no PublishPort               |
12
| WordPress     | `site-<name>`             | `wordpress:php8.3-apache`, no PublishPort  |
13
| DB volume     | `db-<name>-data`          | `/var/lib/mysql`                           |
14
| WP volume     | `wp-<name>-content`       | `/var/www/html` (core, themes, plugins, uploads, `.htaccess`) |
15
| Secrets       | `<name>-db-root-password` | env `MYSQL_ROOT_PASSWORD` in db            |
16
|               | `<name>-db-password`      | env `MYSQL_PASSWORD` (db) + `WORDPRESS_DB_PASSWORD` (site) |
17 1 Redmine Admin
18 2 Redmine Admin
```bash
19 1 Redmine Admin
# Themes / plugins / uploads on the host
20
ls ~/.local/share/containers/storage/volumes/wp-<name>-content/_data/wp-content/themes/
21
22
# wp-config.php reads the DB password from the env at every request — nothing to edit
23
podman exec site-<name> grep -n DB_PASSWORD /var/www/html/wp-config.php
24
25
# PHP upload limit lives in the volume's .htaccess (php_value block), not in the image
26
podman exec site-<name> cat /var/www/html/.htaccess
27
```
28
29
MariaDB access (client only exists inside the container):
30
31 2 Redmine Admin
```bash
32 1 Redmine Admin
podman exec -it db-<name> sh -c 'mariadb -uroot -p"$MYSQL_ROOT_PASSWORD"'
33
podman exec -it db-<name> mariadb -uroot -p'PASSWORD'                 # single quotes: + and =
34
podman exec -it db-<name> mariadb -uroot -p"$(podman secret inspect --showsecret --format '{{.SecretData}}' <name>-db-root-password)"
35
```
36
37 2 Redmine Admin
```sql
38 1 Redmine Admin
SELECT user, host, plugin FROM mysql.user;
39
ALTER USER 'wordpress'@'%' IDENTIFIED BY 'NEW';   -- global, no USE needed
40
FLUSH PRIVILEGES;
41
```
42 2 Redmine Admin
43 1 Redmine Admin
Dump / restore:
44
45 2 Redmine Admin
```bash
46 1 Redmine Admin
podman exec db-<name> sh -c 'mariadb-dump -uroot -p"$MYSQL_ROOT_PASSWORD" wordpress' > ~/tmp/<name>-$(date +%F).sql
47
podman exec -i db-<name> sh -c 'mariadb -uroot -p"$MYSQL_ROOT_PASSWORD" wordpress' < ~/tmp/<name>-YYYY-MM-DD.sql
48
```
49
50 2 Redmine Admin
Staging → production migration = DB dump/restore + `wp-content` copy (incl.
51
`.htaccess`) + search-replace of the URL (`wp search-replace` via WP-CLI or
52 1 Redmine Admin
the Better Search Replace plugin).
53
54 3 Redmine Admin
**What updates where.** The image holds only PHP and Apache plus a copy of WordPress that is
55
used to seed an *empty* volume. Once the volume exists, WordPress itself lives in the volume and
56
is updated there; replacing the image does not touch it.
57 2 Redmine Admin
58 3 Redmine Admin
| Part | Lives in | How it is updated |
59
|
60
61
62 1 Redmine Admin
---
63 3 Redmine Admin
_Source: `dmz-web-podman-cheatsheet.md` v1.8 in the `dmz-web-deploy` repo ([[Releases]]). Edit the wiki and the repo copy together._