Docker-based backend distribution by branch

0

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: dev.example.com

When a new pull request is submitted and distributed, New Domain: 123.dev.example.com If new submitted again, 124.dev.example.com

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.

질문됨 일 년 전170회 조회
1개 답변
0

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.

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 *.dev.example.com
  • 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}.dev.example.com to the target group.
  • That's all.
profile picture
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠