Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 어드민 모듈 리버스 프록싱 v2 #270

Merged
merged 9 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/aws-cicd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- develop
- feat/LA-20
- feat/LA-20_3

env:
REGISTRY: "docker.io"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/aws-cicd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- chore/migration

env:
REGISTRY: "docker.io"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import lombok.RequiredArgsConstructor;

@RequestMapping("/admin/members")
@RequestMapping("/members")
@RequiredArgsConstructor
@RestController
public class AdminMemberController implements AdminMemberApi {
Expand Down
3 changes: 3 additions & 0 deletions layer-admin/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions layer-admin/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions layer-api/infra/development/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions layer-api/infra/production/docker-compose-blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- "3001: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:
18 changes: 18 additions & 0 deletions layer-api/infra/production/docker-compose-green.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
22 changes: 21 additions & 1 deletion layer-api/infra/production/nginx.blue.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ http {
server localhost:8081;
}

upstream layer-admin {
server localhost:3001;
}

# api.layerapp.io에 대한 서버 블록
server {
listen 80;
server_name api.layerapp.io;

location / {
proxy_pass http://layer-api;
Expand All @@ -16,4 +22,18 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}

# admin.api.layerapp.io에 대한 서버 블록
server {
listen 80;
server_name admin-prod.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;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
19 changes: 0 additions & 19 deletions layer-api/infra/production/nginx.conf

This file was deleted.

22 changes: 21 additions & 1 deletion layer-api/infra/production/nginx.green.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ http {
server localhost:8080;
}

upstream layer-admin {
server localhost:3000;
}

# api.layerapp.io에 대한 서버 블록
server {
listen 80;
server_name api.layerapp.io;

location / {
proxy_pass http://layer-api;
Expand All @@ -16,4 +22,18 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}

# admin.api.layerapp.io에 대한 서버 블록
server {
listen 80;
server_name admin-prod.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;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
3 changes: 3 additions & 0 deletions layer-batch/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading