docker: move WORKDIR as on top as possible.

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.
pull/3628/head
muxator 2019-07-12 02:03:25 +02:00 committed by muxator
parent 832e63c691
commit e8e2284884
1 changed files with 3 additions and 2 deletions

View File

@ -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"]