23 lines
522 B
Docker
23 lines
522 B
Docker
FROM docker:latest
|
|
|
|
RUN apk add --no-cache bash postgresql-client gnupg s3cmd jq
|
|
|
|
RUN mkdir -p /etc/cron.d
|
|
|
|
WORKDIR /usr/local/bin
|
|
|
|
COPY backup.sh /usr/local/bin/backup.sh
|
|
RUN chmod +x /usr/local/bin/backup.sh
|
|
|
|
RUN mkdir -p /backup
|
|
|
|
RUN echo "0 0,12 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1" > /etc/cron.d/backup-cron
|
|
|
|
RUN chmod 0644 /etc/cron.d/backup-cron
|
|
RUN crontab /etc/cron.d/backup-cron
|
|
|
|
RUN touch /var/log/backup.log
|
|
|
|
# Run the cron job and tail the logs
|
|
CMD crond && tail -f /var/log/backup.log
|