You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 930B

1234567891011121314151617181920212223242526
  1. FROM node:10-alpine
  2. WORKDIR /opt/app
  3. ENV PORT=80
  4. RUN touch /usr/bin/start.sh # this is the script which will run on start
  5. # if you need a build script, uncomment the line below
  6. # RUN echo 'sh mybuild.sh' >> /usr/bin/start.sh
  7. # if you need redis, uncomment the lines below
  8. # RUN apk --update add redis
  9. # RUN echo 'redis-server &' >> /usr/bin/start.sh
  10. # daemon for cron jobs
  11. # RUN echo 'echo will install crond...' >> /usr/bin/start.sh
  12. # RUN echo 'crond' >> /usr/bin/start.sh
  13. # Basic npm start verification
  14. RUN echo 'nb=`cat package.json | grep start | wc -l` && if test "$nb" = "0" ; then echo "*** Boot issue: No start command found in your package.json in the scripts. See https://docs.npmjs.com/cli/start" ; exit 1 ; fi' >> /usr/bin/start.sh
  15. RUN echo 'npm install --production' >> /usr/bin/start.sh
  16. # npm start, make sure to have a start attribute in "scripts" in package.json
  17. RUN echo 'npm start' >> /usr/bin/start.sh