Skip to content

Commit

Permalink
Refactoring of Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Kaninda committed Aug 30, 2024
1 parent a332203 commit 13237ad
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 <<EOF /usr/local/bin/backup
#!/bin/sh
# shellcheck disable=SC2068
/usr/local/bin/pg-bkup backup $@
EOF
# Create restore shell script
COPY <<EOF /usr/local/bin/restore
#!/bin/sh
# shellcheck disable=SC2068
/usr/local/bin/pg-bkup restore $@
EOF
RUN chmod +x /usr/local/bin/backup && \
# Create the backup script and make it executable
RUN echo '#!/bin/sh\n/usr/local/bin/pg-bkup backup "$@"' > /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"]

0 comments on commit 13237ad

Please sign in to comment.