forked from mattbeedle/docker-postgres-backups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
23 lines (18 loc) · 772 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
FROM postgres:9.4.5
MAINTAINER Siphon <hello@getsiphon.com>
USER root
RUN apt-get update
RUN apt-get install -q -y --force-yes cron gnupg python-pip
# AWS Command Line Interface
RUN pip install awscli==1.9.15
# Note that because cron does not seem to know about Docker's environment
# variables, we have to read them in from a file that we write out
# in entrypoint.sh at runtime.
RUN echo "0 0,6,12,18 * * * env - \`cat /tmp/env.sh\` /bin/bash -c '(cd /code && sh run-backup.sh) >> /code/backups-cron.log 2>>\&1'" | crontab -
RUN mkdir -p /code
WORKDIR /code
ADD entrypoint.sh /code/entrypoint.sh
ADD run-backup.sh /code/run-backup.sh
RUN chmod +x /code/entrypoint.sh
ENTRYPOINT ["sh", "entrypoint.sh"]
CMD [""] # overrides the default from image we inherited from