Project

General

Profile

WordPress » History » Version 3

Redmine Admin, 10/31/2026 02:23 PM
deploy-publish.sh

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