diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b765b09 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine + +LABEL org.opencontainers.image.authors="bluefox@privacynerd.de" + + +WORKDIR / + +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 + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["crond", "-f", "-c", "crond"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..b43f4b2 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,5 @@ +services: + docker-cron-git-pull: + image: testing + volumes: + - ./logs:/logs diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..7a693aa --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +