Sunday, 2 April 2017

How to deploy docker node.js application onto Amazon EC2 with Amazon EC2 container serivice

I have built a node.js application in the docker, every time when I need to run it, I just run the docker and run the command node app.js.

I have set it up on Amazon EC2, but in a vanilla way by register and log into the Amazon EC2 instance, pull the docker image, then run and log into the docker and run the command node app.js.

Now, since Amazon has this EC2 container service, I was told that I can do these two things automatically:

  • EC2 runs the docker
  • Docker runs node app.js

The advantage of doing this is that whenever either docker is crashed or the app is crashed, both of them are crashed, therefore that EC2 can automatically run the command again and rescue them.

How can I set this function up?



via Haohan Wang

No comments:

Post a Comment