docker-images/images/etherpad/Dockerfile

58 lines
1.8 KiB
Docker

ARG REPO_LOCATION
# ARG BASE_VERSION
FROM ${REPO_LOCATION}minideb AS builder
# This is release 1.8.12
# It's important we checkout a specific commit, otherwise etherpad checks out the latest from develop O.o
ARG COMMIT=b99c2cae22f35a0c0831e2fef0719f115b486bd9
RUN install_packages git ca-certificates curl
RUN mkdir -p /srv \
&& git clone --branch master https://github.com/ether/etherpad-lite.git /srv/etherpad \
&& cd /srv/etherpad && git checkout "${COMMIT}" \
&& git status
###############################################################################
FROM ${REPO_LOCATION}minideb-node
COPY --from=builder /srv/etherpad /srv/etherpad
COPY settings.json /srv/etherpad/
# ENV NVM_DIR /root/.nvm
# ENV NODE_VERSION lts/erbium
# lts-erbium = Node.js 12.x
# We speculate that our problems with Etherpad are because we're using a newer version of Node.js..... :-/
# nvm needs curl to download versions of Node.js
# Ref https://stackoverflow.com/a/66521281/1460422
# mkdir -p /.npm \
# && chmod +x $HOME/.nvm/nvm.sh \
# && . $HOME/.nvm/nvm.sh \
# && nvm install $NODE_VERSION \
# && nvm alias default $NODE_VERSION \
# && nvm use default \
RUN install_packages ca-certificates curl
RUN curl -sSL -o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash || true
RUN mkdir /.npm \
&& cd /srv/etherpad \
&& install_packages python3 make sqlite3 libsqlite3-dev gcc g++ libc-dev libc++-dev \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& src/bin/installDeps.sh \
&& cd src && npm install sqlite3 && cd .. \
&& rm -rf /srv/etherpad/.git /.npm/_cacache \
&& chown -R 70:70 /.npm /srv/etherpad
# The rm -rf there is to save some space in the resulting container
USER 70:70
ENV NODE_ENV production
WORKDIR /srv/etherpad
ENTRYPOINT [ "/srv/etherpad/bin/run.sh" ]