Aug 8, 2017 · 1 min read
As suggested by others:
- While testing without docker-compose the author forgot to expose ports. So run it
docker run -p 3000:3000 -ti node-test:0.1 - If you are finding difficulties with nodemon (like it isn't restarting when you edit the files) simply replace the
package.jsonstart script with: "start": "nodemon -L app.js" - If you're on Mac environment you'll probably cannot access your application using
http://localhost:3000because of a limitation of the Docker implementation (as mentioned in https://github.com/docker/for-mac/issues/155 and https://forums.docker.com/t/support-tap-interface-for-direct-container-access-incl-multi-host/17835/23). Instead of usinglocalhostrundocker-machine ipand get the ip address that you will use. In my casehttp://192.168.99.100:3000
