FROM robinthoni/postgres-multiarch:9.6 RUN mv -v /usr/share/postgresql/$PG_MAJOR/pg_hba.conf.sample /usr/share/postgresql/ \ && ln -sv ../pg_hba.conf.sample /usr/share/postgresql/$PG_MAJOR/ RUN apt-get update && apt-get -y install\ cron\ python3\ python3-pip\ &&\ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN pip3 install -U\ argparse RUN mkdir /docker-entrypoint-initdb-core.d COPY ./docker-entrypoint-initdb-core.d/ /docker-entrypoint-initdb-core.d COPY ./backup/pg_backup.config /etc/pg_backup.config COPY ./backup/pg_backup_rotated.sh /usr/local/bin/pg_backup_rotated.sh COPY ./backup/pg_backup_rotated.cron.sh /etc/cron.daily/pg_backup_rotated COPY ./docker-entrypoint.sh /usr/local/bin/ COPY ./migrate.py /usr/local/bin/ RUN rm -rf /var/log/* RUN touch /var/log/migrate.py.logs && chmod 777 /var/log/migrate.py.logs VOLUME "/var/lib/postgresql/backup"