Add cronjob and and logs to container

This commit is contained in:
FarisZR 2022-03-19 03:22:23 +03:00 committed by GitHub
parent 03682333c3
commit 19e94d2208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -9,4 +9,12 @@ RUN go build
FROM alpine
RUN apk add --no-cache restic rclone bash openssh
COPY --from=builder /app/autorestic /usr/bin/autorestic
CMD [ "autorestic" ]
COPY entrypoint.sh /entrypoint.sh
COPY crond.sh /crond.sh
RUN chmod +x /entrypoint.sh /crond.sh
# show autorestic cron logs in docker
RUN ln -sf /proc/1/fd/1 /var/log/autorestic-cron.log
# run autorestic-cron every minute
RUN echo -e "*/1 * * * * bash /crond.sh" >> /etc/crontabs/root
CMD [ "/entrypoint.sh" ]