From c07bfe10bd5488e6cd1a41d36f32d8dfcf7131e3 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 16 May 2020 17:48:27 +0000 Subject: [PATCH] Docker: Add arg for the Etherpad directory This makes it possible for users to match the directory inside the container to the host system (for convenience or to avoid confusion). --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3536e10c5..e76ca5c1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,8 @@ RUN groupadd --system ${EP_GID:+--gid "${EP_GID}" --non-unique} etherpad && \ ${EP_HOME:+--home-dir "${EP_HOME}"} --create-home \ ${EP_SHELL:+--shell "${EP_SHELL}"} etherpad -RUN mkdir /opt/etherpad-lite && chown etherpad:etherpad /opt/etherpad-lite +ARG EP_DIR=/opt/etherpad-lite +RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}" # install abiword for DOC/PDF/ODT export RUN [ -z "${INSTALL_ABIWORD}" ] || (apt update && apt -y install abiword && apt clean && rm -rf /var/lib/apt/lists/*) @@ -63,7 +64,7 @@ RUN [ -z "${INSTALL_SOFFICE}" ] || (apt update && mkdir -p /usr/share/man/man1 & USER etherpad -WORKDIR /opt/etherpad-lite +WORKDIR "${EP_DIR}" COPY --chown=etherpad:etherpad ./ ./ @@ -78,7 +79,7 @@ RUN src/bin/installDeps.sh && \ RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}" || exit 1; done # Copy the configuration file. -COPY --chown=etherpad:etherpad ./settings.json.docker /opt/etherpad-lite/settings.json +COPY --chown=etherpad:etherpad ./settings.json.docker "${EP_DIR}"/settings.json # Fix group permissions RUN chmod -R g=u .