Search code examples
dockerdocker-composeamazon-ecs

Multiple vs single container


I want to put nginx in front of multiple node.js processes (I would like to manage them through pm2). I also want to manage sticky sessions to this multiple node.js processes. How should I do that? Should I do it using two containers (node.js + nginx) or put them in one container somehow?

I suspect if using multiple containers I need to use docker-compose but will I be able do that with ECS?


Solution

  • The good practice is to have two containers and use docker-compose. About ECS please check here, they propose their own stuff and maybe you'd like it https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-compose.html