awslabs/amazon-ecs-nodejs-microservices

Node dependencies

timcurless opened this issue · 2 comments

It looks like they way your instructions are written you are expecting a node_modules folder to be present in the local directory so that it gets packaged into the container image. As it stands if you clone the repo and then build the image it will not run because npm install has not yet been run. I would suggest either:

  1. Update the instructions to have the user run npm install before they docker build so that node_modules gets created. This would obviously also require the user to have Node.js installed on their local workstation, so this leads me to option 2.

  2. Add a RUN npm install instruction to your Dockerfile

Unless it's in there and I just missed it - but two people on my team experienced an ERROR 503 when running the app.

Oh, and, this is a great tutorial. Well done!

Thanks! Looks like there was a lost step that used to be done by this line in the deploy script: https://github.com/awslabs/amazon-ecs-nodejs-microservices/blob/master/3-microservices/deploy.sh#L71

But when we converted it into a step by step tutorial on the website there was no longer any NPM install. Originally I favored installing the dependencies on the host and just copying them into the container because it makes the docker image smaller, but we can also just run the npm install as part of the docker build in order to make it more convenient, and if people really want to optimize their image they can always do the optimization themselves.

I'll merge you PR!

Merged #4

Thanks again!