diff --git a/.gitignore b/.gitignore index 8dbba9d..31bdfb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env docker-compose.yml -default.conf \ No newline at end of file +default.conf +wp-config.php \ No newline at end of file diff --git a/generate-compose-nginx.sh b/generate-compose-nginx.sh index c598df5..6945d95 100755 --- a/generate-compose-nginx.sh +++ b/generate-compose-nginx.sh @@ -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}" diff --git a/wp-config.php b/wp-config.template.php similarity index 100% rename from wp-config.php rename to wp-config.template.php