Skip to content

PG 15 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM alpine:3.15
FROM alpine:3.18

RUN apk update \
&& apk --no-cache add dumb-init postgresql-client curl aws-cli
&& apk --no-cache add dumb-init postgresql15-client curl aws-cli

RUN curl -L https://github.com/odise/go-cron/releases/download/v0.0.7/go-cron-linux.gz | zcat > /usr/local/bin/go-cron && chmod +x /usr/local/bin/go-cron

COPY entrypoint.sh .
COPY backup.sh .

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["sh", "entrypoint.sh"]
CMD ["sh", "entrypoint.sh"]
4 changes: 2 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi

# env vars needed for pg_dump
export PGPASSWORD=$POSTGRES_PASSWORD
POSTGRES_HOST_OPTS="-h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER $POSTGRES_EXTRA_OPTS"
#POSTGRES_HOST_OPTS="-h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER $POSTGRES_EXTRA_OPTS"

case "${PG_BACKUP_ACTION:-dump}" in
dump)
Expand Down Expand Up @@ -55,7 +55,7 @@ case "${PG_BACKUP_ACTION:-dump}" in

# TODO: check if database is fresh
echo "Snapshotting $POSTGRES_DB database"
pg_dump -Fc $POSTGRES_HOST_OPTS $POSTGRES_DB > dump.backup
pg_dump -U $POSTGRES_USER -h $POSTGRES_HOST -p $POSTGRES_PORT -d $POSTGRES_DB -Fc -b -v -f dump.backup
aws configure set default.s3.multipart_chunksize 16MB

if [ "${PRIVATE_BACKUP}" == "true" ] || [ "${PRIVATE_BACKUP}" == "1" ]; then
Expand Down
Loading