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
This commit is contained in:
Cyrille Pontvieux 2020-04-12 09:15:56 +02:00 committed by GitHub
parent 128a3b94f1
commit e090e857dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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