From 13237ad6342a11f83572338b9a51fc790e5dee22 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda <> Date: Fri, 30 Aug 2024 09:20:14 +0200 Subject: [PATCH] Refactoring of Dockerfile --- docker/Dockerfile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 59f5053..44f3b23 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,7 +39,7 @@ ARG DEBIAN_FRONTEND=noninteractive ENV VERSION="v1.2.3" ENV BACKUP_CRON_EXPRESSION="" ENV GNUPGHOME="/tmp/gnupg" -ARG WORKDIR="/app" +ARG WORKDIR="/config" ARG BACKUPDIR="/backup" ARG BACKUP_TMP_DIR="/tmp/backup" ARG BACKUP_CRON="/etc/cron.d/backup_cron" @@ -74,18 +74,14 @@ RUN ln -s /usr/local/bin/pg-bkup /usr/local/bin/bkup ADD docker/supervisord.conf /etc/supervisor/supervisord.conf WORKDIR $WORKDIR -# Create backup shell script -COPY < /usr/local/bin/backup && \ + chmod +x /usr/local/bin/backup + +# Create the restore script and make it executable +RUN echo '#!/bin/sh\n/usr/local/bin/pg-bkup restore "$@"' > /usr/local/bin/restore && \ chmod +x /usr/local/bin/restore +# Create the migrate script and make it executable +RUN echo '#!/bin/sh\n/usr/local/bin/pg-bkup migrate "$@"' > /usr/local/bin/migrate && \ + chmod +x /usr/local/bin/migrate ENTRYPOINT ["/usr/local/bin/pg-bkup"]