Added some improvements learned from CRWT upgrade.

This commit is contained in:
Jonathan Rosenbaum 2025-06-10 18:41:07 +00:00
parent 48a64c674c
commit 002dfea366
4 changed files with 27 additions and 12 deletions

View File

@ -37,6 +37,7 @@ LETSENCRYPT_TEST=true
WORDPRESS_DB_PASSWORD=wordpress # Used for MYSQL_PASSWORD AND MYSQL_ROOT_PASSWORD WORDPRESS_DB_PASSWORD=wordpress # Used for MYSQL_PASSWORD AND MYSQL_ROOT_PASSWORD
MYSQL_DATABASE=wordpress MYSQL_DATABASE=wordpress
MYSQL_USER=wordpress MYSQL_USER=wordpress
TABLE_PREFIX=test # optional
``` ```
### **Volume Configuration** ### **Volume Configuration**
@ -134,16 +135,28 @@ chmod -R [appropriate-permissions] wp-content/
### **5⃣ Optional: Database Updates for web address change** ### **5⃣ Optional: Database Updates for web address change**
```bash ```bash
# Inside the database container
apt-get update && \
apt-get install -y mariadb-client && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# From the host
./update-db ./update-db
``` ```
---
## Tricks of the Trade
Cookie issues prevent login? Add to beginning of wp-config.php.
```bash
ob_start();
```
Change to a different template. Perhaps the current one has broken the site?
```sql
UPDATE wp_options SET option_value = 'twentytwentyfive' WHERE option_name = 'template';
UPDATE wp_options SET option_value = 'twentytwentyfive' WHERE option_name = 'stylesheet';
```
Disable all plugins
```sql
UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';
```
--- ---
## 📌 Requirements ## 📌 Requirements

View File

@ -28,6 +28,7 @@ services:
- MYSQL_ROOT_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake} - MYSQL_ROOT_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake}
- MYSQL_DATABASE=${MYSQL_DATABASE:-wordpress} - MYSQL_DATABASE=${MYSQL_DATABASE:-wordpress}
- MYSQL_USER=${MYSQL_USER:-wordpress} - MYSQL_USER=${MYSQL_USER:-wordpress}
- MARIADB_AUTO_UPGRADE=1
logging: logging:
driver: "json-file" driver: "json-file"
options: options:
@ -49,6 +50,7 @@ services:
- WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake} - WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake}
- MYSQL_DATABASE=${MYSQL_DATABASE:-wordpress} - MYSQL_DATABASE=${MYSQL_DATABASE:-wordpress}
- MYSQL_USER=${MYSQL_USER:-wordpress} - MYSQL_USER=${MYSQL_USER:-wordpress}
- TABLE_PREFIX=${TABLE_PREFIX:-wp_}
- VIRTUAL_HOST=${VIRTUAL_HOST:-wordpress} - VIRTUAL_HOST=${VIRTUAL_HOST:-wordpress}
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST:-wordpress} - LETSENCRYPT_HOST=${LETSENCRYPT_HOST:-wordpress}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-me} - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-me}

View File

@ -10,8 +10,8 @@ command="docker compose exec $DATABASE_SERVICE mariadb"
echo $website echo $website
$command -u $MYSQL_USER $MYSQL_DATABASE -p"$WORDPRESS_DB_PASSWORD" -e "UPDATE cf_options SET option_value='$website' WHERE option_name='home';" $command -u $MYSQL_USER $MYSQL_DATABASE -p"$WORDPRESS_DB_PASSWORD" -e "UPDATE ${TABLE_PREFIX}options SET option_value='$website' WHERE option_name='home';"
$command -u $MYSQL_USER $MYSQL_DATABASE -p"$WORDPRESS_DB_PASSWORD" -e "UPDATE cf_options SET option_value='$website' WHERE option_name='siteurl';" $command -u $MYSQL_USER $MYSQL_DATABASE -p"$WORDPRESS_DB_PASSWORD" -e "UPDATE ${TABLE_PREFIX}options SET option_value='$website' WHERE option_name='siteurl';"
## Add ## Add
# /usr/bin/find /var/www/html/wp-content/uploads/ -type d -exec chmod 755 {} \; -o -type f -exec chmod 644 {} \; # /usr/bin/find /var/www/html/wp-content/uploads/ -type d -exec chmod 755 {} \; -o -type f -exec chmod 644 {} \;

View File

@ -63,7 +63,7 @@ define('NONCE_SALT', '!M@7=}Gsx@4MVX|][e<N--f@BvkG_8,z5*8.G#lPr<Wrl0^0}hEV
* You can have multiple installations in one database if you give each * You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please! * a unique prefix. Only numbers, letters, and underscores please!
*/ */
$table_prefix = 'cf_'; $table_prefix = getenv('TABLE_PREFIX') ?: 'wp_';
/** /**
* For developers: WordPress debugging mode. * For developers: WordPress debugging mode.