Improves for 1st database initializing with proper env var, and corrects update-db.

This commit is contained in:
Jonathan Rosenbaum 2025-06-08 21:49:06 +00:00
parent da76a4f226
commit 075cfed0c5
3 changed files with 10 additions and 6 deletions

View File

@ -34,7 +34,9 @@ LETSENCRYPT_TEST=true
### **Database Configuration** ### **Database Configuration**
```bash ```bash
WORDPRESS_DB_PASSWORD=wordpress WORDPRESS_DB_PASSWORD=wordpress # Used for MYSQL_PASSWORD AND MYSQL_ROOT_PASSWORD
MYSQL_DATABASE=wordpress
MYSQL_USER=wordpress
``` ```
### **Volume Configuration** ### **Volume Configuration**
@ -51,7 +53,7 @@ HTML_VOLUME=test_html_staging
## 📂 Configuration Files ## 📂 Configuration Files
Two important Nginx configuration files are available in the project directory: Two important Nginx configuration files are available in the project directory. After editing, perform a restart:
```bash ```bash
./default.conf # Automatically generated each time the script runs ./default.conf # Automatically generated each time the script runs
./nginx.conf # Manually customizable configuration ./nginx.conf # Manually customizable configuration

View File

@ -23,6 +23,11 @@ services:
container_name: ${COMPOSE_PROJECT_NAME}_database container_name: ${COMPOSE_PROJECT_NAME}_database
volumes: volumes:
- db:/var/lib/mysql - db:/var/lib/mysql
environment:
- MYSQL_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake}
- MYSQL_ROOT_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake}
- MYSQL_DATABASE=${MYSQL_DATABASE:-wordpress}
- MYSQL_USER=${MYSQL_USER:-wordpress}
logging: logging:
driver: "json-file" driver: "json-file"
options: options:

View File

@ -6,9 +6,6 @@ set +o allexport
website="https://$VIRTUAL_HOST" website="https://$VIRTUAL_HOST"
DATABASE_SERVICE="database_${COMPOSE_PROJECT_NAME}" DATABASE_SERVICE="database_${COMPOSE_PROJECT_NAME}"
MYSQL_USER=wordpress
WORDPRESS_DB_PASSWORD=wordpress
MYSQL_DATABASE=wordpress
command="docker compose exec $DATABASE_SERVICE mariadb" command="docker compose exec $DATABASE_SERVICE mariadb"
echo $website echo $website