-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.release
80 lines (67 loc) · 2.27 KB
/
Dockerfile.release
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
# Copyright 2018 Kopano and its licensors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3 or
# later, as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
ARG alpine_version=3.12
FROM alpine:${alpine_version}
RUN apk add --update --no-cache \
libcap \
mailcap \
su-exec
# Expose ports.
EXPOSE 80 443 2015
# Version to include in this Docker image. Default to latest.
ARG VERSION=latest
# Define basic environment variables.
ENV EXE=kwebd
# Defaults which can be overwritten.
ENV KOPANO_KWEB_ASSETS_PATH=/.kweb
ENV KOPANO_KWEB_CFG_SNIPPETS_PATH=/etc/kopano/kweb/snippets.d:/var/lib/kwebd-docker/snippets.d
ENV KOPANO_KWEB_CFG_EXTRA_PATH=/etc/kopano/kweb/extra.d
ENV KOPANO_KWEB_CFG_BASE_PATH=/etc/kopano/kweb/overrides.d:/var/lib/kwebd-docker/defaults.d
ENV KOPANO_KWEB_CFG_HOSTS_PATH=/etc/kopano/kweb/hosts.d:/var/lib/kwebd-docker/hosts.d
ENV ARGS=""
# User and group defaults.
ENV KWEBD_USER=nobody
ENV KWEBD_GROUP=nogroup
WORKDIR /srv
# Copy Docker specific scripts and ensure they are executable.
COPY \
scripts/docker-entrypoint.sh \
scripts/healthcheck.sh \
/usr/local/bin/
RUN chmod 755 /usr/local/bin/*.sh
# Add Docker specific runtime setup functions.
RUN mkdir /etc/defaults && echo -e $'\
setup_secrets() { \n\
true\n\
}\n\
setup_secrets\n\
' > /etc/defaults/docker-env
# Download
RUN apk add --no-cache ca-certificates curl && \
pwd && \
mkdir -p /var/lib/kwebd-docker && \
curl -sSL https://download.kopano.io/community/kweb:/kopano-kweb-${VERSION}.tar.gz | \
tar -C /var/lib/kwebd-docker --strip 1 -vxzf - && \
mv /var/lib/kwebd-docker/${EXE} /usr/local/bin/${EXE} && \
setcap 'cap_net_bind_service=+ep' /usr/local/bin/${EXE}
ENTRYPOINT ["docker-entrypoint.sh"]
CMD [ \
"kwebd", \
"--help" \
]
# Health check support is cool too.
HEALTHCHECK --interval=30s --timeout=5s \
CMD healthcheck.sh