When dockerizing a rails app with EC2 container service with ELB do I still need nginx? -


i have container rails app , puma app server, listening on port 3000.

this container deployed amazons ec2 container service (ecs), , should autoscaled , load balanced via elb.

how nginx (if @ all) fit picture? still need it?

if yes, should package inside rails container, or should create , deploy seperate container instance packaged nginx, provides reverse proxy functionality?

nginx reverse proxy that's great @ handling stuff upstream of rails app. examples include preventing garbage requests getting rails app in first place , serving static assets. it's never idea serve app in production without reverse proxy nginx in front of it. importantly question, true on ecs anywhere else-- ecs runs containers , doesn't reverse proxying in front of them default.

docker style have 1 running process per container. there number of reasons why idea outside of scope of answer, keep short, makes managing containers , letting containers know when die simpler.

so, know want nginx running in front of rails app, , know want 1 process per container, makes sense have 2 containers in case-- 1 puma server running rails app, , other nginx. can link 2 containers, can communicate. finally, can have elb forward requests nginx container, forwards them necessary rails app, , voila, you're done. similar architecture explained in amazon ecs tutorial, if you're looking more details.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -