refactor: clean up Dockerfile

This commit is contained in:
Jonas Kaninda
2024-10-21 08:18:39 +02:00
parent 01c5a061c5
commit f09c1d6fd0

View File

@@ -22,19 +22,12 @@ LABEL version=${appVersion}
LABEL github="github.com/jkaninda/pg-bkup" LABEL github="github.com/jkaninda/pg-bkup"
RUN apk --update add --no-cache postgresql-client tzdata ca-certificates RUN apk --update add --no-cache postgresql-client tzdata ca-certificates
RUN mkdir $WORKDIR RUN mkdir -p $WORKDIR $BACKUPDIR $TEMPLATES_DIR $BACKUP_TMP_DIR && \
RUN mkdir $BACKUPDIR chmod a+rw $WORKDIR $BACKUPDIR $BACKUP_TMP_DIR
RUN mkdir $TEMPLATES_DIR
RUN mkdir -p $BACKUP_TMP_DIR
RUN chmod 777 $WORKDIR
RUN chmod 777 $BACKUPDIR
RUN chmod 777 $BACKUP_TMP_DIR
RUN chmod 777 $WORKDIR
COPY --from=build /app/pg-bkup /usr/local/bin/pg-bkup COPY --from=build /app/pg-bkup /usr/local/bin/pg-bkup
COPY ./templates/* $TEMPLATES_DIR/ COPY ./templates/* $TEMPLATES_DIR/
RUN chmod +x /usr/local/bin/pg-bkup RUN chmod +x /usr/local/bin/pg-bkup && \
ln -s /usr/local/bin/pg-bkup /usr/local/bin/bkup
RUN ln -s /usr/local/bin/pg-bkup /usr/local/bin/bkup
# Create the backup script and make it executable # Create the backup script and make it executable
RUN printf '#!/bin/sh\n/usr/local/bin/pg-bkup backup "$@"' > /usr/local/bin/backup && \ RUN printf '#!/bin/sh\n/usr/local/bin/pg-bkup backup "$@"' > /usr/local/bin/backup && \