change container to do chmod in builder

This commit is contained in:
Michael C 2023-05-23 19:39:16 -04:00
parent 9129cee9f0
commit e253c7bb47
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4

View file

@ -1,11 +1,11 @@
FROM alpine FROM alpine as builder
RUN apk add postgresql-client WORKDIR /scripts
RUN apk add restic --repository http://dl-cdn.alpinelinux.org/alpine/latest-stable/community/ COPY ./backup.sh ./backup.sh
COPY ./forget.sh ./forget.sh
COPY ./backup.sh /usr/src/app/backup.sh FROM alpine
RUN chmod +x /usr/src/app/backup.sh RUN apk add --no-cache postgresql-client restic
COPY ./forget.sh /usr/src/app/forget.sh COPY --from=builder --chmod=755 /scripts /usr/src/app/
RUN chmod +x /usr/src/app/forget.sh
RUN echo '30 * * * * /usr/src/app/backup.sh' >> /etc/crontabs/root RUN echo '30 * * * * /usr/src/app/backup.sh' >> /etc/crontabs/root
RUN echo '10 0 * * 1 /usr/src/app/forget.sh' >> /etc/crontabs/root RUN echo '10 0 * * 1 /usr/src/app/forget.sh' >> /etc/crontabs/root