-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (38 loc) · 1.14 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
50
FROM node:12
USER root
ENV IMAP_HOST=''
ENV IMAP_USER=''
ENV IMAP_PASSWORD=''
ENV IMAP_PORT=993
ENV IMAP_TLS=true
ENV MAIL_STORAGE_PATH='/imap2nas/data'
ENV PHANTOMJS_PATH=/usr/local/bin/phantomjs
ENV GENERATE_HTML=false
ENV GENERATE_PDF=true
ENV SAVE_ATTACHMENTS=true
RUN apt-get update -yqq
RUN mkdir -p /imap2nas/
WORKDIR /imap2nas
COPY package*.json ./
RUN npm install
COPY . .
RUN mkdir -p /imap2nas/data/
RUN chmod +rwx /imap2nas/data/
RUN apt-get install -yqq --no-install-recommends \
ca-certificates \
bzip2 \
curl \
libfontconfig
RUN mkdir -p /tmp/phantomjs \
&& curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
| tar -xj --strip-components=1 -C /tmp/phantomjs \
&& mv /tmp/phantomjs/bin/phantomjs /usr/local/bin
RUN apt-get install -yqq cron
RUN touch /var/log/cron.log
COPY docker/crontab /etc/cron/crontab
RUN chmod +x /etc/cron/crontab
RUN crontab /etc/cron/crontab
RUN printenv | sed 's/^\(.*\)$/export \1/g' > /imap2nas/container_env.sh
RUN chmod +x /imap2nas/container_env.sh
ENTRYPOINT ["/imap2nas/docker/entrypoint.sh"]
CMD cron && tail -f /var/log/cron.log