Skip to content

Commit 3122e26

Browse files
author
Ruben L. Mendoza
authored
Merge pull request #209 from developmentseed/fix/db_backup
Update container for DB backup
2 parents 001076a + a13f250 commit 3122e26

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

images/backup-restore/Dockerfile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
FROM ubuntu:16.04
1+
FROM python:3.9.9
22
ENV workdir /app
33
RUN apt-get update
44
RUN apt-get install -y \
5-
wget \
6-
python-pip \
7-
software-properties-common \
8-
python-software-properties \
9-
curl
10-
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add -
11-
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
12-
RUN apt-get update
13-
RUN apt-get install -y postgresql postgresql-contrib
5+
curl \
6+
postgresql-client
7+
8+
# Install AWS and GCP cli
149
RUN pip install awscli
1510
RUN curl -sSL https://sdk.cloud.google.com | bash
1611
RUN ln -f -s /root/google-cloud-sdk/bin/gsutil /usr/bin/gsutil
1712
WORKDIR $workdir
1813
COPY ./start.sh .
19-
CMD ./start.sh
14+
CMD ./start.sh

images/backup-restore/start.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
export PGPASSWORD=$POSTGRES_PASSWORD
33

44
date=$(date '+%y%m%d_%H%M')
5-
backupFile=osmseed-${date}.sql.gz
5+
backupFile=osmseed-db-${date}.sql.gz
66
stateFile="state.txt"
77
restoreFile="backup.sql.gz"
88

9+
echo "Start... $DB_ACTION action"
910
# Backing up DataBase
1011
if [ "$DB_ACTION" == "backup" ]; then
1112
# Backup database and make maximum compression at the slowest speed

0 commit comments

Comments
 (0)