From e8e22848847ac0cc21f3966ec29cd46ac50d1e82 Mon Sep 17 00:00:00 2001 From: muxator Date: Fri, 12 Jul 2019 02:03:25 +0200 Subject: [PATCH] docker: move WORKDIR as on top as possible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WORKDIR is also valid at build time, thus it makes sense to move it as towards the top as possible. This will come in hand in the next commits, when we will introduce support for installing plugins while building the container. Source: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#workdir [...] you should use WORKDIR instead of proliferating instructions like RUN cd … && do-something, which are hard to read, troubleshoot, and maintain. --- docker/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0bf6a7f28..7e3da1e7b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,8 +33,10 @@ RUN echo "Getting version: ${ETHERPAD_VERSION}" && \ --strip-components=1 && \ rm /opt/etherpad-lite.tar.gz +WORKDIR /opt/etherpad-lite + # install node dependencies for Etherpad -RUN /opt/etherpad-lite/bin/installDeps.sh +RUN bin/installDeps.sh # Copy the custom configuration file, if present. The configuration file has to # be manually put inside the same directory containing the Dockerfile (we cannot @@ -45,5 +47,4 @@ RUN /opt/etherpad-lite/bin/installDeps.sh COPY nop setting[s].json /opt/etherpad-lite/ EXPOSE 9001 -WORKDIR /opt/etherpad-lite CMD ["node", "node_modules/ep_etherpad-lite/node/server.js"]