Update: Entrypoint
This commit is contained in:
parent
4c48932cba
commit
37e404f575
@ -44,5 +44,5 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- ${SSH_PORT}:22
|
- ${SSH_PORT}:22
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app
|
- ./data:/home/user/httpdocs
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -10,6 +10,8 @@ install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config() {
|
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_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_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
|
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;
|
echo $SALT_KEYS >> /app/wordpress/wp-config.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
create_wpconfig() {
|
update() {
|
||||||
if [ -n /app/wordpress/wp-config.php ]; then cp /tmp/wp-config-sample.php /app/wordpress/wp-config.php; fi
|
#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/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -d /app/wordpress ] || install
|
||||||
install
|
[ -f /app/wordpress/wp-config.php ] || config
|
||||||
create_wpconfig
|
#[ -d /app/wordpress ] && update
|
||||||
config
|
|
||||||
|
|
||||||
echo "Starting Wordpress"
|
echo "Starting Wordpress"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user