Made wp-config.php separate from git, so that it can be edited by users.

This commit is contained in:
Jonathan Rosenbaum 2025-06-14 23:44:06 +00:00
parent f53e751901
commit 712e68b2cf
3 changed files with 7 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
.env
docker-compose.yml
default.conf
default.conf
wp-config.php

View File

@ -11,7 +11,6 @@
# Load variables from .env file
if [ -f .env ]; then
source .env
chmod 0664 wp-config.php
fi
export SERVICE_SUFFIX=${COMPOSE_PROJECT_NAME:-main}
@ -20,6 +19,11 @@ export HOST_UID=$(id -u)
export HOST_GID=$(id -g)
envsubst < docker-compose.template.yml > docker-compose.yml
if [ ! -f wp-config.conf ]; then
cp wp-config.template.php wp-config.php
chmod 0664 wp-config.php
fi
# Define the new value for the database host
export new_wp="wordpress_${COMPOSE_PROJECT_NAME}"