From cdfb8860b093b47a0652e2c947fbefb6ee35abcb Mon Sep 17 00:00:00 2001 From: Sejeong Kim Date: Mon, 2 Dec 2024 14:39:46 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20deploy.sh=EC=97=90=20=EC=96=B4?= =?UTF-8?q?=EB=93=9C=EB=AF=BC=20=EB=AA=A8=EB=93=88=20=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/aws-cicd-prod.yml | 2 +- .../member/controller/AdminMemberController.java | 2 +- .../infra/production/docker-compose-blue.yaml | 15 +++++++++++++++ .../infra/production/docker-compose-green.yaml | 15 +++++++++++++++ layer-api/infra/production/nginx.blue.conf | 12 +++++++++++- layer-api/infra/production/nginx.green.conf | 12 +++++++++++- 6 files changed, 54 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aws-cicd-prod.yml b/.github/workflows/aws-cicd-prod.yml index 120105e4..0fe3a56a 100644 --- a/.github/workflows/aws-cicd-prod.yml +++ b/.github/workflows/aws-cicd-prod.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - chore/migration + - chore/LA-28 env: REGISTRY: "docker.io" diff --git a/layer-admin/src/main/java/org/layer/member/controller/AdminMemberController.java b/layer-admin/src/main/java/org/layer/member/controller/AdminMemberController.java index 1d85167b..795efed0 100644 --- a/layer-admin/src/main/java/org/layer/member/controller/AdminMemberController.java +++ b/layer-admin/src/main/java/org/layer/member/controller/AdminMemberController.java @@ -10,7 +10,7 @@ import lombok.RequiredArgsConstructor; -@RequestMapping("/admin/members") +@RequestMapping("/members") @RequiredArgsConstructor @RestController public class AdminMemberController implements AdminMemberApi { diff --git a/layer-api/infra/production/docker-compose-blue.yaml b/layer-api/infra/production/docker-compose-blue.yaml index 82d57859..07496c7d 100644 --- a/layer-api/infra/production/docker-compose-blue.yaml +++ b/layer-api/infra/production/docker-compose-blue.yaml @@ -13,6 +13,21 @@ services: - ./tokens:/config/tokens networks: - app-network + - + layer-admin-blue: + image: docker.io/clean01/layer-server_layer-admin:latest + container_name: layer-admin-blue + ports: + - "8082:8080" + environment: + - TZ=Asia/Seoul + - SPRING_PROFILES_ACTIVE=prod + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./log:/log + - ./tokens:/config/tokens + networks: + - app-network batch-job-blue: image: docker.io/clean01/layer-server_layer-batch:latest diff --git a/layer-api/infra/production/docker-compose-green.yaml b/layer-api/infra/production/docker-compose-green.yaml index bf36a0b6..90a2766a 100644 --- a/layer-api/infra/production/docker-compose-green.yaml +++ b/layer-api/infra/production/docker-compose-green.yaml @@ -14,6 +14,21 @@ services: networks: - app-network + layer-admin-green: + image: docker.io/clean01/layer-server_layer-admin:latest + container_name: layer-admin-green + ports: + - "8082:8080" + environment: + - TZ=Asia/Seoul + - SPRING_PROFILES_ACTIVE=prod + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./log:/log + - ./tokens:/config/tokens + networks: + - app-network + batch-job-green: image: docker.io/clean01/layer-server_layer-batch:latest container_name: layer-batch-green diff --git a/layer-api/infra/production/nginx.blue.conf b/layer-api/infra/production/nginx.blue.conf index 326ea474..eeb60d50 100644 --- a/layer-api/infra/production/nginx.blue.conf +++ b/layer-api/infra/production/nginx.blue.conf @@ -8,6 +8,7 @@ http { server { listen 80; + # 기존 라우팅 (서비스 api) location / { proxy_pass http://layer-api; proxy_set_header Host $host; @@ -15,5 +16,14 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + # /admin 요청 라우팅 + location /layer-admin { + proxy_pass http://localhost:8083; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } } -} \ No newline at end of file +} diff --git a/layer-api/infra/production/nginx.green.conf b/layer-api/infra/production/nginx.green.conf index a7f4110b..9db8a8e1 100644 --- a/layer-api/infra/production/nginx.green.conf +++ b/layer-api/infra/production/nginx.green.conf @@ -8,6 +8,7 @@ http { server { listen 80; + # 기존 라우팅 (서비스 api) location / { proxy_pass http://layer-api; proxy_set_header Host $host; @@ -15,5 +16,14 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + # /admin 요청 라우팅 + location /admin { + proxy_pass http://localhost:8082; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } } -} \ No newline at end of file +}