-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
29 lines (25 loc) · 994 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM mimicmobile/dockup:latest
LABEL maintainer="Jeff Corcoran <jcorcoran+github@gmail.com>"
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/mimicmobile/dockup-postgres.git" \
org.label-schema.vcs-ref=$VCS_REF
# install Postgres shell & tools
ENV PG_MAJOR 9.6
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
RUN apt-get update && apt-get install -y \
postgresql-client-$PG_MAJOR
ENV PATHS_TO_BACKUP /dockup/pgdump
VOLUME ["/dockup/pgdump"]
ENV POSTGRES_BACKUP_NAME pgdump
ENV BEFORE_BACKUP_CMD ./pgdump.sh
ENV AFTER_BACKUP_CMD ./pgclean.sh
ENV AFTER_RESTORE_CMD ./pgrestore.sh
ENV POSTGRES_USER postgres
ENV POSTGRES_HOST db
ENV POSTGRES_DB postgres
ENV POSTGRES_PORT 5432
COPY /scripts /dockup/
RUN chmod 755 /dockup/*.sh