etherpad: use nvm to install an old version of Node.js

This commit is contained in:
Starbeamrainbowlabs 2021-04-18 13:10:25 +01:00
parent 005ae56b38
commit 64ba3712f4
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 14 additions and 4 deletions

View File

@ -7,23 +7,33 @@ FROM ${REPO_LOCATION}minideb-node AS builder
# 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
RUN install_packages git ca-certificates curl
RUN mkdir -p /srv \
&& curl -sSL -o /srv/nvm_install.sh https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh \
&& 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
FROM ${REPO_LOCATION}minideb
COPY --from=builder /srv/nvm_install.sh /srv/nvm_install.sh
COPY --from=builder /srv/etherpad /srv/etherpad
COPY settings.json /srv/etherpad/
ENV PYTHON /usr/bin/python3
RUN mkdir -p /.npm
RUN cd /srv/etherpad \
# 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
RUN install_packages ca-certificates curl \
&& mkdir -p /.npm \
&& bash /srv/nvm_install.sh \
&& nvm install lts/erbium \
&& cd /srv/etherpad \
&& install_packages python3 make gcc g++ libc-dev libc++-dev \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& src/bin/installDeps.sh \