FROM robinthoni/postgres-backup-multiarch:9.6

ARG CONFIG_DIR=/etc/default/config-files/

RUN rm -rf /var/log/*

COPY ./vars-vars /etc/vars-vars

COPY ./vars-files /etc/vars-files

COPY ./common.sh /common.sh

COPY ./run.sh /run.sh

RUN mkdir "${CONFIG_DIR}"

COPY ./config/postgresql.conf "${CONFIG_DIR}"/postgresql.conf

COPY ./config/recovery.conf "${CONFIG_DIR}"/recovery.conf

ENTRYPOINT ["/bin/sh", "-c"]

CMD ["/run.sh"]
