Home > Mobile >  How to use AWS to deploy multi-container Docker App
How to use AWS to deploy multi-container Docker App

Time:08-13

I have been programming a full-stack application consisting of a NodeJS frontend, .Net Backend, and SQL Server DB and I have managed to fully dockerize the application using docker-compose. I have come a long way since I started this project but I still need a bit more help to finalize it. I am now in the process of deploying my docker containers into AWS (somehow) and I am having a bit of a problem on my end. Please bear in mind I am a beginner and this is quite complex to me.

So far this is the closest I have come to an actual solution to properly deploying all 3 parts of the app.

  1. Created a security group w/ Inbound to all IPv4s and IPv6s, Outbound to all IPv4s
  2. Created a load balancer listening on port 80 with default VPC
  3. Created a key pair to SSH
  4. Created a cluster with 3 instances (backend, frontend, db) default VPC, SG created, default role
  5. Created ECR and pushed all my docker images seperately, 3 ECRs
  6. Created EC2 task def, no role, 512 mem, container with each ECR url, 512 mem, 0:80 mapping
  7. (Unsure if necessary) Created a service to link the LB etc. When I do this, I am able to run all 3 tasks at the same time with no issues so it seems like progress to me. However, I am doing something wrong when it comes to the ports or IPs since I am not able to access the public DNS or even SSH to any of the instances, it times out.

Question:

  • Have I made an error anywhere? Specifically, in the ports or IP, I am not sure where the mistake is

Notes:

  • This is a simple project which I will have up for maybe 1-2 months, I do not plan on spending more than $5-$10. It is just a simple project with CRUD operations.
  • The end goal is simply to have everything up on AWS and running together, so I can perform CRUD on the DB, nothing long-term or complex.

P.S I MUST use AWS

CodePudding user response:

The simplest way to achieve your goal considering the amount you want to spend would be to move your solution to EC2 as described by you. What issues do you face doing so?

You may also explore the integration of Docker Compose and ECS

Also check this out - https://aws.amazon.com/blogs/containers/deploy-applications-on-amazon-ecs-using-docker-compose/

  • Related