Enabled first start functionality

This commit is contained in:
Deon George 2017-04-21 14:02:19 +10:00
parent 39be522172
commit 9218b58a71
2 changed files with 10 additions and 2 deletions

View File

@ -38,6 +38,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
@ -49,5 +50,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"

9
init
View File

@ -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
@ -64,7 +71,9 @@ if [ "$1" == "start" ]; then
echo "! NOT starting HTTP"
fi
firststart
wait
else
firststart
exec $@
fi