Created
February 11, 2020 15:18
-
-
Save PatricNox/ca7cd7d170d3e0dba5da7c70a74d22fe to your computer and use it in GitHub Desktop.
Init script for Wordpress sites through Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This file needs to be executed once a new file system is imported. | |
# What this does, is updating project settings to have localhost as root. | |
# | |
# Dev settings & htaccess. | |
if [ -f "src/wp-config.php" ]; then | |
rm src/wp-config.php | |
echo '.. wp-config already exists. Removing.' | |
fi | |
cp src/wp-config.php.dev src/wp-config.php | |
echo '.. Dev wp-config created.' | |
# Incase we run init twice, don't override existing .live file | |
HTACCESS_FILE_LIVE=src/.htaccess.live | |
if [ ! -f "$HTACCESS_FILE_LIVE" ]; then | |
cp src/.htaccess src/.htaccess.live | |
cp src/.htaccess.dev src/.htaccess | |
echo ".. Dev htaccess created, renamed live to \".htaccess.live\"" | |
fi | |
# Database adaptions. | |
# Tell wordpress that the site should be runned on localhost. | |
chmod +x ./db-init.sh ; ./db-init.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
continued at https://gist.github.com/PatricNox/a4c3801f638ed0447089a561e35f8493