moved oasst-postgres

This commit is contained in:
Yannic Kilcher
2023-01-17 12:25:26 +01:00
parent 8ed80525c1
commit 3749791bce
3 changed files with 3 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM postgres:15
# install unzip
RUN apt-get update && apt-get install -y unzip curl && rm -rf /var/lib/apt/lists/*
# download aws cli
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip -q awscliv2.zip
RUN ./aws/install
COPY ./backup_pg_to_s3.sh .
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
set -x
# filename with timestamp
filename="postgres-$(date +%Y-%m-%d_%H-%M-%S).sql"
# perform pg_dump
pg_dump -U postgres postgres > /tmp/$filename
# upload to s3
aws s3 cp /tmp/$filename s3://$S3_BUCKET_NAME/$filename
rm /tmp/$filename