Enabled first start functionality

This commit is contained in:
Deon George 2017-04-21 14:02:19 +10:00
parent 6538e0f130
commit 73b93c5879
2 changed files with 10 additions and 2 deletions

View File

@ -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 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 -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" ] VOLUME [ "/etc/ssh" ]
EXPOSE 80 443 EXPOSE 80 443
@ -50,5 +51,3 @@ LABEL cron.daily root:/usr/bin/tdp.mysql.sh -s information_schema:performance_sc
COPY init /sbin/ COPY init /sbin/
ENTRYPOINT [ "/sbin/init" ] ENTRYPOINT [ "/sbin/init" ]
CMD [ "start" ] 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) [ "$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 trap 'stop' SIGTERM
if [ "$1" == "start" ]; then if [ "$1" == "start" ]; then
@ -65,7 +72,9 @@ if [ "$1" == "start" ]; then
echo "! NOT starting HTTP" echo "! NOT starting HTTP"
fi fi
firststart
wait wait
else else
firststart
exec $@ exec $@
fi fi