-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (21 loc) · 1.08 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
FROM alpine:latest
LABEL maintainer="[email protected]"
RUN apk update && apk add --no-cache python3 py3-pip && pip3 install --upgrade pip && apk add mongodb-tools && pip3 install awscli && apk add mysql-client && apk add bash && apk add openssl && apk add coreutils && apk add curl && mkdir -p /opt/backup
ARG HOUR_OF_DAY
#ENV CRON_HOUR=${HOUR_OF_DAY:-23}
WORKDIR /opt/backup
COPY crontab.txt crontab.txt
COPY entry.sh entry.sh
COPY script.sh script.sh
COPY mysql/mysql-backup.sh mysql/mysql-backup.sh
COPY mysql/backup.sh mysql/backup.sh
COPY mysql/clean.sh mysql/clean.sh
COPY mongodb/mongo-backup.sh mongodb/mongo-backup.sh
COPY mongodb/s3.sh mongodb/s3.sh
COPY mongodb/clean.sh mongodb/clean.sh
RUN chmod 750 entry.sh script.sh
RUN chmod 750 mysql/mysql-backup.sh mysql/backup.sh mysql/clean.sh
RUN chmod 750 mongodb/mongo-backup.sh mongodb/s3.sh mongodb/clean.sh
#RUN if [[ -n "$HOUR_OF_DAY" ]] ; then echo $HOUR_OF_DAY && sed -i "s/23/$HOUR_OF_DAY/g" crontab.txt && cat crontab.txt ; else echo "Defaulting to cron hour 23" ; fi
#RUN /usr/bin/crontab crontab.txt
CMD ["/opt/backup/entry.sh"]