Hey thanks its a nice one. I just want to tweak a bit your Dockerfile to make the image smaller and cleaner. Check this out:
FROM node:latest RUN mkdir /src WORKDIR /src ADD app/package.json /src/package.json ## THE LIFE SAVER RUN npm install && \ curl -L https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait \ -o ./node_modules/.bin/wait && \ chmod +x ./node_modules/.bin/wait EXPOSE 3000 ENTRYPOINT [ "npm" ] ## Launch the wait tool and then your application CMD [ "run", "start:docker" ]
in your package.json scripts make a script like so
"start:docker": "wait && npm start"
Any executable in the node_modules/.bin folder is automatically added to your path when running thorugh npm. Enjoy!
node_modules/.bin
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey thanks its a nice one. I just want to tweak a bit your Dockerfile to make the image smaller and cleaner. Check this out:
in your package.json scripts make a script like so
Any executable in the
node_modules/.bin
folder is automatically added to your path when running thorugh npm. Enjoy!