diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-09-21 19:57:11 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-11-05 15:36:15 +0300 |
commit | d0a839c09db4aab2c63cf832465880da537c9367 (patch) | |
tree | e909ff2079da0ef760204ae08c821e93d2ea92e4 /docker/lamp | |
parent | fa2279faa9c5db091b97376a323275ad1f368ef6 (diff) |
added docker-x86: nc and ncp for development. Update docker-armhf
Diffstat (limited to 'docker/lamp')
-rwxr-xr-x | docker/lamp/010-lamp-run.sh | 30 | ||||
-rw-r--r-- | docker/lamp/Dockerfile | 11 |
2 files changed, 26 insertions, 15 deletions
diff --git a/docker/lamp/010-lamp-run.sh b/docker/lamp/010-lamp-run.sh index 69d8c13f..9552d848 100755 --- a/docker/lamp/010-lamp-run.sh +++ b/docker/lamp/010-lamp-run.sh @@ -1,16 +1,22 @@ #!/bin/bash +source /usr/local/etc/library.sh + set -e -case "$1" in - stop) - apachectl graceful-stop - killall php-fpm7.0 - mysqladmin -u root shutdown - echo "LAMP cleanup complete" - exit 0 - ;; -esac +[[ "$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 & @@ -21,4 +27,10 @@ echo "Starting Apache" echo "Starting mariaDB" mysqld & +# wait for mariadb +while :; do + [[ -S /var/run/mysqld/mysqld.sock ]] && break + sleep 0.5 +done + exit 0 diff --git a/docker/lamp/Dockerfile b/docker/lamp/Dockerfile index 54b5c666..e6e77b93 100644 --- a/docker/lamp/Dockerfile +++ b/docker/lamp/Dockerfile @@ -1,12 +1,11 @@ -# docker run -d -p 443:443 -p 80:80 -v ncdata:/data --name lamp ownyourbits/lamp -# docker build . -f lamp.dockerfile -t ownyourbits/lamp-arm:latest - -FROM ownyourbits/miniraspbian +FROM ownyourbits/debian-ncp-x86 MAINTAINER Ignacio Núñez Hernanz <nacho@ownyourbits.com> SHELL ["/bin/bash", "-c"] +ENV DOCKERBUILD 1 + COPY etc/library.sh lamp.sh /usr/local/etc/ RUN \ @@ -32,9 +31,9 @@ rm -f /var/log/alternatives.log /var/log/apt/*; \ # specific cleanup rm /data/database/ib_logfile*; \ -rm /usr/local/etc/{lamp.sh,library.sh} +rm /usr/local/etc/lamp.sh -COPY docker/lamp/010-lamp-run.sh /etc/cont-init.d/ +COPY docker/lamp/010-lamp-run.sh /etc/services.d/ ENTRYPOINT ["/run-parts.sh"] |