From 73b93c5879c8454859ac54cc5972900ac12ec99f Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 21 Apr 2017 14:02:19 +1000 Subject: [PATCH] Enabled first start functionality --- Dockerfile | 3 +-- init | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index da8904d..014a45d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,6 +39,7 @@ COPY 10-default.conf /etc/httpd/conf.d/ RUN ln -f /etc/.ln/httpd/conf.d/awstats.conf /etc/httpd/conf.d/awstats.conf && ln -f /etc/.ln/opendkim.conf /etc/opendkim.conf RUN useradd -c "Hosting Admin User" -m lamp -G apache +RUN useradd -rc "Composer" -m composer -s /sbin/nologin && su composer -s /bin/bash -lc "composer global require laravel/installer && composer require --dev --no-update xethron/migrations-generator:dev-l5 && composer require --dev --no-update way/generators:dev-feature/laravel-five-stable && composer config repositories.repo-name git git@github.com:jamisonvalenta/Laravel-4-Generators.git" VOLUME [ "/etc/ssh" ] EXPOSE 80 443 @@ -50,5 +51,3 @@ LABEL cron.daily root:/usr/bin/tdp.mysql.sh -s information_schema:performance_sc COPY init /sbin/ ENTRYPOINT [ "/sbin/init" ] CMD [ "start" ] - -RUN useradd -rc "Composer" -m composer -s /sbin/nologin && su composer -s /bin/bash -lc "composer global require laravel/installer && composer require --dev --no-update xethron/migrations-generator:dev-l5 && composer require --dev --no-update way/generators:dev-feature/laravel-five-stable && composer config repositories.repo-name git git@github.com:jamisonvalenta/Laravel-4-Generators.git" diff --git a/init b/init index 596c195..05a5814 100755 --- a/init +++ b/init @@ -16,6 +16,13 @@ function stop { [ "$NO_HTTP" != "TRUE" ] && rm -f /var/run/httpd/authdigest_shm.$(cat /var/run/httpd/httpd.pid) && kill $(cat /var/run/httpd/httpd.pid) } +function firststart { + if [ -x /usr/local/sbin/firststart.sh ]; then + /usr/local/sbin/firststart.sh + [ $? -eq 0 ] && rm /usr/local/sbin/firststart.sh + fi +} + trap 'stop' SIGTERM if [ "$1" == "start" ]; then @@ -65,7 +72,9 @@ if [ "$1" == "start" ]; then echo "! NOT starting HTTP" fi + firststart wait else + firststart exec $@ fi