Skip to content
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

Pg16 r2 #6

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Another one
dmirgaleev committed Oct 3, 2023
commit 4b865c963d036c66fa6983bff5ccbdfba6eb3f11
19 changes: 2 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
FROM alpine:3.15
FROM google/cloud-sdk:alpine

RUN apk update \
&& apk --no-cache add dumb-init postgresql-client curl python3

RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-396.0.0-linux-x86_64.tar.gz

# ARM
# RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-396.0.0-linux-arm.tar.gz

RUN tar -xf google-cloud-cli-396.0.0-linux-x86_64.tar.gz

RUN ./google-cloud-sdk/install.sh --usage-reporting false -q

RUN rm google-cloud-cli-396.0.0-linux-x86_64.tar.gz

ENV PATH $PATH:/google-cloud-sdk/bin/

ADD boto.config /root/.boto
&& apk --no-cache add dumb-init postgresql-client curl

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

7 changes: 4 additions & 3 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -48,9 +48,10 @@ case "${PG_BACKUP_ACTION:-dump}" in
AWS_ARGS="--endpoint-url ${S3_ENDPOINT}"
fi

echo "Configuring ACCESS KEYS"
sed -i "s|replace_gs_access_key_id|$S3_ACCESS_KEY_ID|g" /root/.boto
sed -i "s|replace_gs_secret_access_key|$S3_SECRET_ACCESS_KEY|g" /root/.boto
# Google Cloud Auth
echo "Authenticating to Google Cloud..."
echo $S3_SECRET_ACCESS_KEY | base64 -d > /key.json
gcloud auth activate-service-account --key-file /key.json --project "$S3_ACCESS_KEY_ID" -q

# env vars needed for aws tools
export AWS_ACCESS_KEY_ID=$S3_ACCESS_KEY_ID