mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
moved oasst-postgres
This commit is contained in:
@@ -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 .
|
||||
Executable
+15
@@ -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
|
||||
Reference in New Issue
Block a user