Update: Entrypoint

This commit is contained in:
Luca 2022-02-26 20:51:09 +00:00
parent 4c48932cba
commit 37e404f575
2 changed files with 11 additions and 7 deletions

View File

@ -44,5 +44,5 @@ services:
ports:
- ${SSH_PORT}:22
volumes:
- ./data:/app
- ./data:/home/user/httpdocs
restart: always

View File

@ -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"