Implemented docker-entrypoint.sh and moved some contents from Dockerfile into the docker-entrypoint.sh script

This commit is contained in:
2024-09-22 19:19:15 +02:00
parent 45b032c470
commit 0f59d94821
2 changed files with 96 additions and 11 deletions

View File

@@ -5,15 +5,8 @@ LABEL org.opencontainers.image.authors="bluefox@privacynerd.de"
WORKDIR /
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN apk update --no-cache && \
apk add --no-cache git && \
adduser -g cronuser -s /bin/sh -H -D cronuser && \
mkdir crond logs && \
touch logs/crond.log logs/puller.log && \
chown cronuser logs -R && \
echo $'#!/bin/sh\ncd /to-pull && git pull' > puller.sh && \
echo $'* * * * * cronuser /puller.sh\n' > crond/cronuser && \
chmod +x puller.sh
apk add --no-cache git
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["crond", "-f", "-c", "crond"]
ENTRYPOINT ["/docker-entrypoint.sh"]