-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
68 lines (66 loc) · 1.85 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
64
65
66
67
68
FROM alpine:3.15.4 as base
FROM base as dl
ARG VERSION
ARG CHECKSUM
WORKDIR /tmp
ARG FILENAME="${VERSION}.tar.gz"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN \
echo "**** install packages ****" && \
apk add --no-cache \
wget=1.21.2-r2 && \
echo "**** download haste ****" && \
mkdir /app && \
wget -q --progress=dot:giga "https://github.com/ether/etherpad-lite/archive/${FILENAME}" && \
echo "${CHECKSUM} ${FILENAME}" | sha256sum -c && \
tar -xvf "${FILENAME}" -C /app --strip-components 1
WORKDIR /app
RUN \
echo "**** cleanup ****" && \
rm -rf \
./*.md \
.github \
.gitignore \
Dockerfile \
doc \
Makefile \
settings.json\
src/node_modules
FROM base
ARG BUILD_DATE
ARG VERSION
ARG ETHERPAD_PLUGINS=""
# hadolint ignore=DL3048
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="nicholaswilde"
ENV NODE_ENV=production
RUN \
echo "**** install packages ****" && \
apk add --no-cache \
nodejs=16.14.2-r0 \
tzdata=2022a-r0 \
npm=8.1.3-r0 && \
adduser -S etherpad --uid 5001 && \
mkdir /opt/etherpad-lite && \
echo "**** cleanup ****" && \
rm -rf /tmp/*
WORKDIR /opt/etherpad-lite
COPY --from=dl /app ./
COPY --from=dl /app/settings.json.docker /opt/etherpad-lite/settings.json
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN \
echo "**** install packages ****" && \
bin/installDeps.sh && \
rm -rf ~/.npm/_cacache && \
echo "**** install plugins ****" && \
for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}" || exit 1; done && \
echo "**** change permissions ****" && \
chmod -R g=u . && \
chown -R etherpad:0 /opt/etherpad-lite && \
chown -R 5001:65533 "/root/.npm"
USER etherpad
EXPOSE 9001
VOLUME \
/opt/etherpad-lite/var \
/opt/etherpad-lite
CMD ["node", "--experimental-worker", "node_modules/ep_etherpad-lite/node/server.js"]