Use nginx container-specific init folder
This commit is contained in:
parent
89c55a4a90
commit
11edf32c68
10
Dockerfile
10
Dockerfile
@ -4,12 +4,4 @@ FROM nginx:mainline-alpine
|
|||||||
RUN apk add hugo git
|
RUN apk add hugo git
|
||||||
|
|
||||||
# Copy over auxiliary scripts
|
# Copy over auxiliary scripts
|
||||||
COPY aux /aux
|
COPY aux/* /docker-entrypoint.d/
|
||||||
|
|
||||||
# Cron hook for pulling and building
|
|
||||||
RUN echo "10 * * * * /aux/pull-n-build.sh" >> /var/spool/cron/crontabs/root
|
|
||||||
|
|
||||||
# bootstrap script, basically cron && build
|
|
||||||
# after that, the base-image-specific CMD will kick in, which is quite complex
|
|
||||||
ENTRYPOINT /aux/bootstrap.sh
|
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# stop on error
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# start cron daemon (goes into background)
|
|
||||||
crond
|
|
||||||
|
|
||||||
# pull and build freshly
|
|
||||||
/aux/pull-n-build.sh
|
|
||||||
|
|
||||||
# run nginx
|
|
||||||
nginx -g "daemon off;"
|
|
15
aux/cron.sh
Executable file
15
aux/cron.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# stop on error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$BUILDFREQ" == "" ]; then
|
||||||
|
# set default
|
||||||
|
BUILDFREQ=10
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the pull script regularly
|
||||||
|
echo "$BUILDFREQ * * * * /docker-entrypoint.d/pull-n-build.sh" >> /var/spool/cron/crontabs/root
|
||||||
|
|
||||||
|
# start cron daemon (goes into background)
|
||||||
|
crond
|
Loading…
Reference in New Issue
Block a user