Docker-based backend distribution by branch


Hello. Nice to meet you.

I'd like to distribute the service using dockers on the backend.

Once the pull request is complete on the backend, we are considering how to deploy and assign domains. dev branch → default domain:

When a new pull request is submitted and distributed, New Domain: If new submitted again,

In summary, I would like to have it distributed by branch and distributed when that branch is created.

I want this kind of composition. What should I do? I need your help. Thank you.

asked 14 days ago23 views
1 Answer

This is a very abstract question. Even if you use Docker containers, there are various ways to solve the problem depending on the current architecture configuration.

Let's take an example of solving a problem with a simple assumption.


  • Use Route53 Hosted Zone
  • Use AWS ECR
  • 1 ALB
  • 1 EC2 instance per service. (Not multi-tenant)
  • No ECS, EKS, Fargate

Problem Solving

  • Create A Alias record for the ALB with *
  • When the specific event(Pull request is submitted) occurs, just do following
    • build Image and push to ECR registry.
    • Create EC2 instance
    • Install Docker.
    • Pull the corresponding container image from ECR registry, and run the container!
    • Create a target group including the above EC2 instance.
    • Add Listener Rule for the ALB with Host condition ${something} to the target group.
  • That's all.
answered 13 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions