-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
63 lines (56 loc) · 1.57 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
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM php:7.1-fpm-alpine
ARG ZPUSH_URL=http://download.z-push.org/final/2.3/z-push-2.3.9.tar.gz
ARG ZPUSH_CSUM=2c761f89f2922935d9e9ed29d5daf161
ARG UID=1513
ARG GID=1513
ENV TIMEZONE=Europe/Zurich \
IMAP_SERVER=localhost \
IMAP_PORT=143 \
SMTP_SERVER=tls://localhost \
SMTP_PORT=465
ADD root /
RUN set -ex \
# Install important stuff
&& apk add --update --no-cache \
alpine-sdk \
autoconf \
bash \
imap \
imap-dev \
nginx \
openssl \
openssl-dev \
pcre \
pcre-dev \
supervisor \
tar \
tini \
wget
# Install php
RUN docker-php-ext-configure imap --with-imap --with-imap-ssl \
&& docker-php-ext-install imap pcntl sysvmsg sysvsem sysvshm \
&& pecl install APCu-5.1.8 \
&& docker-php-ext-enable apcu \
# Remove dev packages
&& apk del --no-cache \
alpine-sdk \
autoconf \
openssl-dev \
pcre-dev
# Add user for z-push
RUN addgroup -g ${GID} zpush \
&& adduser -u ${UID} -h /opt/zpush -H -G zpush -s /sbin/nologin -D zpush \
&& mkdir -p /opt/zpush
# Install z-push
RUN wget -q -O /tmp/zpush.tgz "$ZPUSH_URL" \
&& if [ "$ZPUSH_CSUM" != "$(md5sum /tmp/zpush.tgz | awk '{print($1)}')" ]; then echo "Wrong md5sum of downloaded file!"; exit 1; fi \
&& tar -zxf /tmp/zpush.tgz -C /opt/zpush --strip-components=1 \
&& rm /tmp/zpush.tgz \
&& chmod +x /usr/local/bin/docker-run.sh \
&& mv /opt/zpush/config.php /opt/zpush/config.php.dist \
&& mv /opt/zpush/backend/imap/config.php /opt/zpush/backend/imap/config.php.dist
VOLUME ["/state"]
VOLUME ["/config"]
EXPOSE 80
ENTRYPOINT ["/sbin/tini", "--"]
CMD /usr/local/bin/docker-run.sh