diff options
Diffstat (limited to 'docker-common/lamp/010lamp')
-rwxr-xr-x | docker-common/lamp/010lamp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/docker-common/lamp/010lamp b/docker-common/lamp/010lamp new file mode 100755 index 00000000..9552d848 --- /dev/null +++ b/docker-common/lamp/010lamp @@ -0,0 +1,36 @@ +#!/bin/bash + +source /usr/local/etc/library.sh + +set -e + +[[ "$1" == "stop" ]] && { + echo "Stopping apache" + apachectl graceful-stop + echo "Stopping PHP-fpm" + killall php-fpm7.0 + echo "Stopping mariaDB" + mysqladmin -u root shutdown + echo "LAMP cleanup complete" + exit 0 +} + +# MOVE CONFIGS TO PERSISTENT VOLUME +persistent_cfg /etc/apache2 + +echo "Starting PHP-fpm" +php-fpm7.0 & + +echo "Starting Apache" +/usr/sbin/apache2ctl start + +echo "Starting mariaDB" +mysqld & + +# wait for mariadb +while :; do + [[ -S /var/run/mysqld/mysqld.sock ]] && break + sleep 0.5 +done + +exit 0 |