From e090e857dd67f0e88bf27cb192d1c72d854068a4 Mon Sep 17 00:00:00 2001 From: Cyrille Pontvieux Date: Sun, 12 Apr 2020 09:15:56 +0200 Subject: [PATCH] Do not install on run (#30) * Do not install on run The docker image should contains already resolved dependencies. No need for a start.sh, you could just run node directly. * Simplify Dockerfile --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c373bc3..c4edde3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,12 @@ FROM node:10-alpine -WORKDIR /opt/app COPY . /opt/app +WORKDIR /opt/app +RUN npm install --production ENV PORT=80 EXPOSE 80 VOLUME /opt/app/server-data -RUN touch /usr/bin/start.sh # this is the script which will run on start - -RUN echo 'npm install --production' >> /usr/bin/start.sh -RUN echo 'node /opt/app/server/server.js' >> /usr/bin/start.sh - -CMD ["/bin/sh","/usr/bin/start.sh"] +CMD ["npm", "start"]