forked from ether/etherpad-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TomNewChao
committed
Mar 29, 2024
1 parent
2be7338
commit 74dd2f1
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM openeuler/openeuler:23.09 | ||
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite" | ||
RUN yum install -y ca-certificates git shadow wget xz | ||
RUN mkdir -p /opt/soft/ && mkdir -p /opt/soft/node && mkdir -p /opt/etherpad-lite | ||
RUN cd /opt/soft/ && wget https://nodejs.org/dist/v18.20.0/node-v18.20.0-linux-x64.tar.xz && tar -xf node-v18.20.0-linux-x64.tar.xz -C /opt/soft/node && rm -rf /opt/soft/node-v18.20.0-linux-x64.tar.xz | ||
RUN ln -s /opt/soft/node/node-v18.20.0-linux-x64/bin/npm /usr/bin/npm && ln -s /opt/soft/node/node-v18.20.0-linux-x64/bin/node /usr/bin/node | ||
RUN npm config set registry https://registry.npmmirror.com && npm install pnpm -g && npm install typescript -g | ||
RUN ln -s /opt/soft/node/node-v18.20.0-linux-x64/bin/pnpm /usr/bin/pnpm | ||
|
||
ARG INSTALL_ABIWORD= | ||
ARG INSTALL_SOFFICE= | ||
ARG EP_HOME= | ||
ARG EP_SHELL= | ||
ARG EP_UID=5001 | ||
ARG EP_GID=0 | ||
ARG EP_DIR=/opt/etherpad-lite | ||
ARG ETHERPAD_PLUGINS="ep_font_size ep_font_color ep_font_family ep_headings2 ep_themes" | ||
RUN groupadd --system ${EP_GID:+--gid "${EP_GID}" --non-unique} etherpad && \ | ||
useradd --system ${EP_UID:+--uid "${EP_UID}" --non-unique} --gid etherpad \ | ||
${EP_HOME:+--home-dir "${EP_HOME}"} --create-home \ | ||
${EP_SHELL:+--shell "${EP_SHELL}"} etherpad | ||
RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}" | ||
RUN mkdir -p /usr/share/man/man1 | ||
|
||
COPY --chown=etherpad:etherpad ./ /opt/etherpad-lite | ||
COPY --chown=etherpad:etherpad ./settings.json.docker "${EP_DIR}"/settings.json | ||
RUN cd /opt/etherpad-lite/admin && pnpm install && pnpm run build --outDir ./dist | ||
RUN cd /opt/etherpad-lite/ui && pnpm install && pnpm run build --outDir ./dist | ||
RUN cp -r /opt/etherpad-lite/admin/dist /opt/etherpad-lite/src/templates/admin | ||
RUN cp -r /opt/etherpad-lite/ui/dist /opt/etherpad-lite/src/static/oidc | ||
|
||
# RUN { [ -z "${ETHERPAD_PLUGINS}" ] || npm install --no-save ${ETHERPAD_PLUGINS}; } && src/bin/installDeps.sh && rm -rf ~/.npm | ||
RUN sh -x /opt/etherpad-lite/bin/installDeps.sh | ||
RUN cd /opt/etherpad-lite/ && pnpm config set registry https://registry.npm.taobao.org && pnpm run install-plugins ${ETHERPAD_PLUGINS}; | ||
RUN chown -R etherpad:etherpad /opt/etherpad-lite && chmod -R 750 /opt/etherpad-lite | ||
|
||
USER etherpad | ||
ENV NODE_ENV=production | ||
WORKDIR "${EP_DIR}" | ||
|
||
HEALTHCHECK --interval=20s --timeout=3s CMD curl -f http://localhost:9001 || exit 1 | ||
|
||
EXPOSE 9001 | ||
CMD ["pnpm", "run", "prod"] |