Update: Entrypoint
This commit is contained in:
parent
4c48932cba
commit
37e404f575
@ -44,5 +44,5 @@ services:
|
||||
ports:
|
||||
- ${SSH_PORT}:22
|
||||
volumes:
|
||||
- ./data:/app
|
||||
- ./data:/home/user/httpdocs
|
||||
restart: always
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user