forked from charleszlu/docker-autopostgresqlbackup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 1.13 KB
/
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
29
30
31
32
33
34
35
FROM ubuntu:latest
# Labels
LABEL maintainer="Paulino Padial <github.com/ppadial>"
# Environment variables (with default values)
ENV CRON_LOG_LEVEL=8
# PostgreSQL 10 repository install
RUN apt-get update && \
apt-get install -y wget lsb-release gnupg && \
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list
# Packages installation
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y autopostgresqlbackup cron bzip2 gzip postgresql-client && \
apt-get purge -y --auto-remove && \
rm -rf /var/lib/apt/lists/*
# Copy files to the image
ADD autopostgresqlbackup.conf /etc/default/autopostgresqlbackup
ADD autopostgresqlbackup /usr/sbin/autopostgresqlbackup
RUN chmod 755 /usr/sbin/autopostgresqlbackup
RUN mkfifo /var/spool/postfix/public/pickup
# Configure entrypoint
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Volumes declaration
VOLUME ["/backups"]
# Start the container process
ENTRYPOINT ["/docker-entrypoint.sh"]