diff --git a/docker-compose.yml b/docker-compose.yml index 312948a..4b56999 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,5 +44,5 @@ services: ports: - ${SSH_PORT}:22 volumes: - - ./data:/app + - ./data:/home/user/httpdocs restart: always diff --git a/entrypoint.sh b/entrypoint.sh index 8784097..2612c6b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,6 +10,8 @@ install() { } config() { + if [ -n /app/wordpress/wp-config.php ]; then cp /tmp/wp-config-sample.php /app/wordpress/wp-config.php; fi + if [ -n $MYSQL_DATABASE ]; then sed -i "s:MYSQL_DATABASE:$MYSQL_DATABASE:" /app/wordpress/wp-config.php; fi if [ -n $MYSQL_USER ]; then sed -i "s:MYSQL_USER:$MYSQL_USER:" /app/wordpress/wp-config.php; fi if [ -n $MYSQL_PASSWORD ]; then sed -i "s:MYSQL_PASSWORD:$MYSQL_PASSWORD:" /app/wordpress/wp-config.php; fi @@ -19,14 +21,16 @@ config() { echo $SALT_KEYS >> /app/wordpress/wp-config.php; } -create_wpconfig() { - if [ -n /app/wordpress/wp-config.php ]; then cp /tmp/wp-config-sample.php /app/wordpress/wp-config.php; fi +update() { + #https://make.wordpress.org/cli/handbook/ + wp core update --path="/app/wordpress/" + wp plugin update --all --path="/app/wordpress/" + wp theme update --all --path="/app/wordpress/" } - -install -create_wpconfig -config +[ -d /app/wordpress ] || install +[ -f /app/wordpress/wp-config.php ] || config +#[ -d /app/wordpress ] && update echo "Starting Wordpress"