feat(deploy): RTGS 3센터 컨테이너 배포 산출물

- Dockerfile.backend: 7서비스 공용 이미지(멀티스테이지 gradle 빌드, SERVICE env 선택, curl 포함)
- docker-compose.yml: PG(3DB)+Kafka+순번기+DC1/DC2/DC3 각6서비스+프론트, 컨테이너 격리로 포트오프셋 불필요, depends_on 헬스 순서
- Dockerfile.frontend+nginx.conf: 콘솔+DT 정적빌드→nginx 서빙+API 리버스프록시(X-RTGS-DC 헤더/dcN 경로 센터 라우팅)
- init/init-3centers.sql, .dockerignore, README(Coder 런북 + Coolify 어댑테이션/정책 경고)
- vite.config: 배포 빌드에 dt.html 엔트리 추가(콘솔+DT 한번에)

빌드/기동 검증은 Coder(podman)에서 — 로컬 PC는 Docker 미지원. 프론트 build·compose 구조는 로컬 정적 검증 완료.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
rtgs
2026-07-16 18:14:03 +09:00
parent 427f361783
commit 0c29884780
8 changed files with 357 additions and 0 deletions

45
deploy/nginx.conf Normal file
View File

@@ -0,0 +1,45 @@
# RTGS 프론트(콘솔 + DT) 정적 서빙 + API 리버스프록시.
# dev의 vite proxy를 대체: 콘솔은 X-RTGS-DC 헤더로, DT는 /dcN/ 경로로 대상 센터를 고른다.
# 컨테이너 DNS(127.0.0.11)로 service name 동적 해석 → proxy_pass 변수 사용.
# 콘솔용 센터 라우팅(요청 헤더 X-RTGS-DC 기준). 기본 DC1.
map $http_x_rtgs_dc $chanel_up { default "dc1-chanel:8091"; "DC2" "dc2-chanel:8091"; "DC3" "dc3-chanel:8091"; }
map $http_x_rtgs_dc $lv_up { default "dc1-louisvuitton:8099"; "DC2" "dc2-louisvuitton:8099"; "DC3" "dc3-louisvuitton:8099"; }
map $http_x_rtgs_dc $gucci_up { default "dc1-gucci:8095"; "DC2" "dc2-gucci:8095"; "DC3" "dc3-gucci:8095"; }
server {
listen 80;
server_name _;
resolver 127.0.0.11 valid=10s; # Docker/compose 내장 DNS (service name 동적 해석)
root /usr/share/nginx/html;
index index.html;
# --- DT 단말: /dc1|/dc2|/dc3/... → 해당 센터 Gucci (prefix 제거) ---
location ~ ^/dc([123])/(.*)$ {
set $dt_gucci "dc$1-gucci:8095";
proxy_pass http://$dt_gucci/$2$is_args$args;
proxy_set_header Host $host;
}
# --- 콘솔 API: Chanel 계열 ---
location ~ ^/(accounts|inquiry|pay|meta|rawmessage|notifications|ledger)(/|$) {
proxy_pass http://$chanel_up;
proxy_set_header Host $host;
}
# --- 콘솔 API: 관리(LouisVuitton) ---
location ~ ^/(admin|console)(/|$) {
proxy_pass http://$lv_up;
proxy_set_header Host $host;
}
# --- 콘솔 API: Gucci(로그인 등) ---
location /gucci/ {
proxy_pass http://$gucci_up;
proxy_set_header Host $host;
}
# --- 정적 파일 + SPA 폴백(콘솔). dt.html 은 그대로 서빙 ---
location / {
try_files $uri $uri/ /index.html;
}
}