mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 06:24:17 +00:00
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:
parent
128a3b94f1
commit
e090e857dd
1 changed files with 3 additions and 7 deletions
10
Dockerfile
10
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"]
|
||||
|
|
Loading…
Reference in a new issue