Add startup script support
This commit is contained in:
parent
0a239137b0
commit
3d3a0be3cc
|
@ -22,6 +22,9 @@ RUN crontab /etc/cron.d/certbot
|
||||||
COPY ./scripts/ /scripts
|
COPY ./scripts/ /scripts
|
||||||
RUN chmod +x /scripts/*.sh
|
RUN chmod +x /scripts/*.sh
|
||||||
|
|
||||||
|
# Add /scripts/startup directory to source more startup scripts
|
||||||
|
RUN mkdir -p /scripts/startup
|
||||||
|
|
||||||
# Copy in default nginx configuration (which just forwards ACME requests to
|
# Copy in default nginx configuration (which just forwards ACME requests to
|
||||||
# certbot, or redirects to HTTPS, but has no HTTPS configurations by default).
|
# certbot, or redirects to HTTPS, but has no HTTPS configurations by default).
|
||||||
RUN rm -f /etc/nginx/conf.d/*
|
RUN rm -f /etc/nginx/conf.d/*
|
||||||
|
|
|
@ -17,6 +17,12 @@ export NGINX_PID=$!
|
||||||
# Next, run certbot to request all the ssl certs we can find
|
# Next, run certbot to request all the ssl certs we can find
|
||||||
/scripts/run_certbot.sh
|
/scripts/run_certbot.sh
|
||||||
|
|
||||||
|
# Lastly, run startup scripts
|
||||||
|
for f in /scripts/startup/*.sh; do
|
||||||
|
echo "Running startup script $f"
|
||||||
|
$f
|
||||||
|
done
|
||||||
|
|
||||||
# Run `cron -f &` so that it's a background job owned by bash and then `wait`.
|
# Run `cron -f &` so that it's a background job owned by bash and then `wait`.
|
||||||
# This allows SIGINT (e.g. CTRL-C) to kill cron gracefully, due to our `trap`.
|
# This allows SIGINT (e.g. CTRL-C) to kill cron gracefully, due to our `trap`.
|
||||||
cron -f &
|
cron -f &
|
||||||
|
|
Loading…
Reference in New Issue