Use tini as init for entrypoint script
Signed-off-by: Robert Dailey <rcdailey@gmail.com>
This commit is contained in:
parent
e9b5772dae
commit
26bf5c5f82
2 changed files with 4 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
RUN apk add --no-cache docker bash
|
RUN apk add --no-cache docker bash tini
|
||||||
|
|
||||||
ENV NEXTCLOUD_EXEC_USER=www-data
|
ENV NEXTCLOUD_EXEC_USER=www-data
|
||||||
ENV NEXTCLOUD_CONTAINER_NAME=
|
ENV NEXTCLOUD_CONTAINER_NAME=
|
||||||
|
@ -10,7 +10,7 @@ ENV NEXTCLOUD_CRON_MINUTE_INTERVAL=15
|
||||||
COPY scripts/*.sh /
|
COPY scripts/*.sh /
|
||||||
COPY scripts/cron-scripts /cron-scripts
|
COPY scripts/cron-scripts /cron-scripts
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
|
||||||
|
|
||||||
HEALTHCHECK --timeout=5s \
|
HEALTHCHECK --timeout=5s \
|
||||||
CMD ["/healthcheck.sh"]
|
CMD ["/healthcheck.sh"]
|
||||||
|
|
|
@ -27,16 +27,5 @@ echo "$containerId" > /tmp/containerId
|
||||||
echo "*/$NEXTCLOUD_CRON_MINUTE_INTERVAL * * * * /cron-tasks.sh $containerId" \
|
echo "*/$NEXTCLOUD_CRON_MINUTE_INTERVAL * * * * /cron-tasks.sh $containerId" \
|
||||||
> /var/spool/cron/crontabs/root
|
> /var/spool/cron/crontabs/root
|
||||||
|
|
||||||
# Watch for SIGTERM (someone stops the docker container) so we can tell crond to exit
|
echo "Starting crond"
|
||||||
_term() {
|
exec crond -f -l 0
|
||||||
echo "Caught SIGTERM signal!"
|
|
||||||
kill -TERM "$child" 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
trap _term SIGTERM
|
|
||||||
|
|
||||||
exec crond -f -l 0 &
|
|
||||||
echo "Started crond"
|
|
||||||
|
|
||||||
child=$!
|
|
||||||
wait "$child"
|
|
||||||
|
|
Loading…
Reference in a new issue