-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
49 lines (43 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM alpine:latest
# GMVAULT_DIR allows using a location that is not the default $HOME/.gmvault.
ENV GMVAULT_DIR="/data" \
GMVAULT_EMAIL_ADDRESS="[email protected]" \
GMVAULT_FULL_SYNC_SCHEDULE="1 3 * * 0" \
GMVAULT_QUICK_SYNC_SCHEDULE="1 2 * * 1-6" \
GMVAULT_DEFAULT_GID="9000" \
GMVAULT_DEFAULT_UID="9000" \
CRONTAB="/var/spool/cron/crontabs/gmvault"
VOLUME $GMVAULT_DIR
RUN mkdir /app
# Set up environment.
RUN apk add --update \
bash \
ca-certificates \
mailx \
py-pip \
python2 \
ssmtp \
shadow \
su-exec \
tzdata \
&& python -m ensurepip \
&& pip install --upgrade pip \
&& pip install gmvault \
&& rm -rf /var/cache/apk/* \
&& addgroup -g "$GMVAULT_DEFAULT_GID" gmvault \
&& adduser \
-H `# No home directory` \
-D `# Don't assign a password` \
-u "$GMVAULT_DEFAULT_UID" \
-s "/bin/bash" \
-G "gmvault" \
gmvault
# Monkey-patch to support large mailboxes.
RUN sed -i '/^import imaplib/a imaplib._MAXLINE = 10000000' $(find / -name 'imapclient.py')
# Copy cron jobs.
COPY backup_quick.sh /app/
COPY backup_full.sh /app/
# Set up entry point.
COPY start.sh /app/
WORKDIR /app
ENTRYPOINT ["/app/start.sh"]