From 4ec455e8fe849dfee2db6f3ae1378f0121f462cc Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 16:56:02 +0900 Subject: [PATCH 1/9] =?UTF-8?q?chore:=20nginx=20=EB=A6=AC=EB=B2=84?= =?UTF-8?q?=EC=8A=A4=20=ED=94=84=EB=A1=9D=EC=8B=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/infra/production/nginx.blue.conf | 12 ++++++++++++ layer-api/infra/production/nginx.conf | 19 ------------------- layer-api/infra/production/nginx.green.conf | 12 ++++++++++++ 3 files changed, 24 insertions(+), 19 deletions(-) delete mode 100644 layer-api/infra/production/nginx.conf diff --git a/layer-api/infra/production/nginx.blue.conf b/layer-api/infra/production/nginx.blue.conf index 326ea474..cca4ea42 100644 --- a/layer-api/infra/production/nginx.blue.conf +++ b/layer-api/infra/production/nginx.blue.conf @@ -5,6 +5,10 @@ http { server localhost:8081; } + upstream layer-admin { + server localhost:3000; + } + server { listen 80; @@ -15,5 +19,13 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + location /admin/ { + proxy_pass http://layer-admin; + 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.conf b/layer-api/infra/production/nginx.conf deleted file mode 100644 index 4bcbe484..00000000 --- a/layer-api/infra/production/nginx.conf +++ /dev/null @@ -1,19 +0,0 @@ -events { } - -http { - upstream layer-api { - server layer-api:8080; - } - - server { - listen 80; - - location / { - proxy_pass http://layer-api; - 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..8fc4e848 100644 --- a/layer-api/infra/production/nginx.green.conf +++ b/layer-api/infra/production/nginx.green.conf @@ -5,6 +5,10 @@ http { server localhost:8080; } + upstream layer-admin { + server localhost:3000; + } + server { listen 80; @@ -15,5 +19,13 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + location /admin/ { + proxy_pass http://layer-admin; + 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 From ae72b63fe6b1398154c0f009489083637d2be51c Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 16:56:25 +0900 Subject: [PATCH 2/9] =?UTF-8?q?chore:=20admin=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EC=BB=A8=ED=85=8C=EC=9D=B4=EB=84=88=EC=97=90=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/aws-cicd-dev.yml | 1 - .github/workflows/aws-cicd-prod.yml | 2 +- .../infra/production/docker-compose-blue.yaml | 18 ++++++++++++++++++ .../infra/production/docker-compose-green.yaml | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-cicd-dev.yml b/.github/workflows/aws-cicd-dev.yml index 9fdcb789..5f65117e 100644 --- a/.github/workflows/aws-cicd-dev.yml +++ b/.github/workflows/aws-cicd-dev.yml @@ -4,7 +4,6 @@ on: push: branches: - develop - - feat/LA-20 env: REGISTRY: "docker.io" diff --git a/.github/workflows/aws-cicd-prod.yml b/.github/workflows/aws-cicd-prod.yml index 120105e4..9ca076c5 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 + - feat/LA-20_3 env: REGISTRY: "docker.io" diff --git a/layer-api/infra/production/docker-compose-blue.yaml b/layer-api/infra/production/docker-compose-blue.yaml index 82d57859..70b0ebc7 100644 --- a/layer-api/infra/production/docker-compose-blue.yaml +++ b/layer-api/infra/production/docker-compose-blue.yaml @@ -29,5 +29,23 @@ services: - layer-api-blue restart: always + admin-app-blue: + image: docker.io/clean01/layer-server_layer-admin:latest # + container_name: layer-admin-blue + ports: + - "3000:3000" + environment: + - TZ=Asia/Seoul + - SPRING_PROFILES_ACTIVE=prod + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./log:/log + - ./tokens:/config/tokens + networks: + - app-network + depends_on: + - layer-api-blue + restart: always + networks: app-network: \ No newline at end of file diff --git a/layer-api/infra/production/docker-compose-green.yaml b/layer-api/infra/production/docker-compose-green.yaml index bf36a0b6..9df97019 100644 --- a/layer-api/infra/production/docker-compose-green.yaml +++ b/layer-api/infra/production/docker-compose-green.yaml @@ -29,5 +29,23 @@ services: - layer-api-green restart: always + admin-app-green: + image: docker.io/clean01/layer-server_layer-admin:latest # + container_name: layer-admin-green + ports: + - "3000:3000" + environment: + - TZ=Asia/Seoul + - SPRING_PROFILES_ACTIVE=prod + volumes: + - ./application-secret.properties:/config/application-secret.properties + - ./log:/log + - ./tokens:/config/tokens + networks: + - app-network + depends_on: + - layer-api-green + restart: always + networks: app-network: \ No newline at end of file From 42a386fbf67211efe8a4fb542be913bf22d98156 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 17:42:34 +0900 Subject: [PATCH 3/9] =?UTF-8?q?chore:=20=EC=BB=A4=EB=84=A5=EC=85=98=20?= =?UTF-8?q?=ED=92=80=20=EC=88=98=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-admin/src/main/resources/application-dev.yml | 3 +++ layer-admin/src/main/resources/application-prod.yml | 3 +++ layer-batch/src/main/resources/application.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/layer-admin/src/main/resources/application-dev.yml b/layer-admin/src/main/resources/application-dev.yml index 941c6352..b68b603a 100644 --- a/layer-admin/src/main/resources/application-dev.yml +++ b/layer-admin/src/main/resources/application-dev.yml @@ -9,6 +9,9 @@ spring: username: ${AWS_PROD_DB_NAME} password: ${AWS_PROD_DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver + hikari: + maximum-pool-size: 5 # 최대 pool 크기 + minimum-idle: 5 # 최소 pool 크기 jpa: hibernate: ddl-auto: validate diff --git a/layer-admin/src/main/resources/application-prod.yml b/layer-admin/src/main/resources/application-prod.yml index d053cad6..54120ad1 100644 --- a/layer-admin/src/main/resources/application-prod.yml +++ b/layer-admin/src/main/resources/application-prod.yml @@ -9,6 +9,9 @@ spring: username: ${AWS_PROD_DB_NAME} password: ${AWS_PROD_DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver + hikari: + maximum-pool-size: 5 # 최대 pool 크기 + minimum-idle: 5 # 최소 pool 크기 jpa: hibernate: ddl-auto: validate diff --git a/layer-batch/src/main/resources/application.yml b/layer-batch/src/main/resources/application.yml index 07de1fe2..d009e947 100644 --- a/layer-batch/src/main/resources/application.yml +++ b/layer-batch/src/main/resources/application.yml @@ -9,6 +9,9 @@ spring: username: ${AWS_PROD_DB_NAME} password: ${AWS_PROD_DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver + hikari: + maximum-pool-size: 5 # 최대 pool 크기 + minimum-idle: 5 # 최소 pool 크기 jpa: hibernate: ddl-auto: validate From 71504fc9e863f12fe6db2d7f71fffda52f79f57c Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 19:42:39 +0900 Subject: [PATCH 4/9] =?UTF-8?q?chore:=20nginx=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/infra/production/nginx.blue.conf | 12 ++++++++++-- layer-api/infra/production/nginx.green.conf | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/layer-api/infra/production/nginx.blue.conf b/layer-api/infra/production/nginx.blue.conf index cca4ea42..ad41afc8 100644 --- a/layer-api/infra/production/nginx.blue.conf +++ b/layer-api/infra/production/nginx.blue.conf @@ -9,8 +9,10 @@ http { server localhost:3000; } + # api.layerapp.io에 대한 서버 블록 server { listen 80; + server_name api.layerapp.io; location / { proxy_pass http://layer-api; @@ -19,8 +21,14 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + } - location /admin/ { + # admin.api.layerapp.io에 대한 서버 블록 + server { + listen 80; + server_name admin.api.layerapp.io; + + location / { proxy_pass http://layer-admin; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -28,4 +36,4 @@ http { 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 8fc4e848..7fa19fc0 100644 --- a/layer-api/infra/production/nginx.green.conf +++ b/layer-api/infra/production/nginx.green.conf @@ -9,8 +9,10 @@ http { server localhost:3000; } + # api.layerapp.io에 대한 서버 블록 server { listen 80; + server_name api.layerapp.io; location / { proxy_pass http://layer-api; @@ -19,8 +21,14 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + } - location /admin/ { + # admin.api.layerapp.io에 대한 서버 블록 + server { + listen 80; + server_name admin.api.layerapp.io; + + location / { proxy_pass http://layer-admin; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -28,4 +36,4 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } } -} \ No newline at end of file +} From 7bf371b1d706ece6530de0d678ceb2bd13f81cef Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 20:42:31 +0900 Subject: [PATCH 5/9] =?UTF-8?q?chore:=20nginx=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/infra/production/nginx.blue.conf | 2 +- layer-api/infra/production/nginx.green.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layer-api/infra/production/nginx.blue.conf b/layer-api/infra/production/nginx.blue.conf index ad41afc8..b4562669 100644 --- a/layer-api/infra/production/nginx.blue.conf +++ b/layer-api/infra/production/nginx.blue.conf @@ -26,7 +26,7 @@ http { # admin.api.layerapp.io에 대한 서버 블록 server { listen 80; - server_name admin.api.layerapp.io; + server_name admin-prod.layerapp.io; location / { proxy_pass http://layer-admin; diff --git a/layer-api/infra/production/nginx.green.conf b/layer-api/infra/production/nginx.green.conf index 7fa19fc0..f03454f1 100644 --- a/layer-api/infra/production/nginx.green.conf +++ b/layer-api/infra/production/nginx.green.conf @@ -26,7 +26,7 @@ http { # admin.api.layerapp.io에 대한 서버 블록 server { listen 80; - server_name admin.api.layerapp.io; + server_name admin-prod.layerapp.io; location / { proxy_pass http://layer-admin; From 8bb06db305c5380daa35f2ceaa8a6eb28a1f4243 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 21:11:44 +0900 Subject: [PATCH 6/9] =?UTF-8?q?chore:=20blue=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=ED=95=B8=EB=93=A4=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/infra/production/docker-compose-blue.yaml | 2 +- layer-api/infra/production/nginx.blue.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layer-api/infra/production/docker-compose-blue.yaml b/layer-api/infra/production/docker-compose-blue.yaml index 70b0ebc7..1f7311d0 100644 --- a/layer-api/infra/production/docker-compose-blue.yaml +++ b/layer-api/infra/production/docker-compose-blue.yaml @@ -33,7 +33,7 @@ services: image: docker.io/clean01/layer-server_layer-admin:latest # container_name: layer-admin-blue ports: - - "3000:3000" + - "3001:3000" environment: - TZ=Asia/Seoul - SPRING_PROFILES_ACTIVE=prod diff --git a/layer-api/infra/production/nginx.blue.conf b/layer-api/infra/production/nginx.blue.conf index b4562669..d8486355 100644 --- a/layer-api/infra/production/nginx.blue.conf +++ b/layer-api/infra/production/nginx.blue.conf @@ -6,7 +6,7 @@ http { } upstream layer-admin { - server localhost:3000; + server localhost:3001; } # api.layerapp.io에 대한 서버 블록 From 93717af975f08d22361cecbd6e782bb8dfd99fbc Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 21:20:01 +0900 Subject: [PATCH 7/9] =?UTF-8?q?chore:=20=EC=97=94=EB=93=9C=ED=8F=AC?= =?UTF-8?q?=EC=9D=B8=ED=8A=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/layer/member/controller/AdminMemberController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From 2d4267c4b61a4e197f45e12cb0bf77b0e3d8f78d Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 21:22:31 +0900 Subject: [PATCH 8/9] =?UTF-8?q?chore:=20dev=20nginx=20conf=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/infra/development/nginx.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/layer-api/infra/development/nginx.conf b/layer-api/infra/development/nginx.conf index 639490fb..fabe06a6 100644 --- a/layer-api/infra/development/nginx.conf +++ b/layer-api/infra/development/nginx.conf @@ -9,8 +9,10 @@ http { server layer-admin:3000; } + # api.layerapp.io에 대한 서버 블록 server { listen 80; + server_name api.layerapp.io; location / { proxy_pass http://layer-api; @@ -19,9 +21,15 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + } - location /admin/ { - proxy_pass http://layer-admin; # Proxy to layer-admin + # admin.api.layerapp.io에 대한 서버 블록 + server { + listen 80; + server_name admin-dev.layerapp.io; + + location / { + proxy_pass http://layer-admin; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; From a383e9b200a3d51e1dc7a4b3bc09baf432a9a147 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 3 Dec 2024 21:25:49 +0900 Subject: [PATCH 9/9] =?UTF-8?q?chore:=20dev=20=EB=B8=8C=EB=9E=9C=EC=B9=98?= =?UTF-8?q?=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/aws-cicd-dev.yml | 1 + .github/workflows/aws-cicd-prod.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-cicd-dev.yml b/.github/workflows/aws-cicd-dev.yml index 5f65117e..37627514 100644 --- a/.github/workflows/aws-cicd-dev.yml +++ b/.github/workflows/aws-cicd-dev.yml @@ -4,6 +4,7 @@ on: push: branches: - develop + - feat/LA-20_3 env: REGISTRY: "docker.io" diff --git a/.github/workflows/aws-cicd-prod.yml b/.github/workflows/aws-cicd-prod.yml index 9ca076c5..33aa5669 100644 --- a/.github/workflows/aws-cicd-prod.yml +++ b/.github/workflows/aws-cicd-prod.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - feat/LA-20_3 env: REGISTRY: "docker.io"