From 19bd4285e171ae67a1d196d71ad04834ee133442 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 17 Sep 2022 21:02:00 +1000 Subject: [PATCH] changing name to db-container now it works --- db-container/Dockerfile | 17 +++++++++++++++++ db-container/crontab | 1 + 2 files changed, 18 insertions(+) create mode 100644 db-container/Dockerfile create mode 100644 db-container/crontab diff --git a/db-container/Dockerfile b/db-container/Dockerfile new file mode 100644 index 0000000..67c8512 --- /dev/null +++ b/db-container/Dockerfile @@ -0,0 +1,17 @@ +FROM postgres:latest +USER root +ENV TZ=Australia/Melbourne +RUN truncate -s0 /tmp/preseed.cfg && \ + (echo "tzdata tzdata/Areas select Australia" >> /tmp/preseed.cfg) && \ + (echo "tzdata tzdata/Zones/Australia select Melbourne" >> /tmp/preseed.cfg) && \ + debconf-set-selections /tmp/preseed.cfg && \ + rm -f /etc/timezone /etc/localtime && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ + apt-get install -y tzdata +## cleanup of files from setup +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN apt-get update && apt-get -y install cron +COPY crontab /etc/crontab +EXPOSE 5432 +CMD ["sh", "-c", "cron ; /usr/local/bin/docker-entrypoint.sh postgres"] diff --git a/db-container/crontab b/db-container/crontab new file mode 100644 index 0000000..9699ea6 --- /dev/null +++ b/db-container/crontab @@ -0,0 +1 @@ +* * * * * root pg_dump -a --user=pa --table=person --table=refimg --table=person_refimg_link > /tmp/new_users.sql