Files
rtgs/frontend/vite.config.ts
rtgs 0c29884780 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>
2026-07-16 18:14:03 +09:00

38 lines
1.2 KiB
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// RTGS 조회/관리 콘솔 (:5174). 요청 헤더 X-RTGS-DC(DC1/DC2/DC3)로 대상 센터 포트를 라우팅한다.
// Chanel계열 8091 / LouisVuitton(admin) 8099 / Gucci 8095, 센터별 +100/+200 오프셋.
const OFFSET: Record<string, number> = { DC1: 0, DC2: 100, DC3: 200 }
const off = (req: any) => OFFSET[(req.headers?.['x-rtgs-dc'] as string) || 'DC1'] ?? 0
const routed = (basePort: number) => ({
target: `http://localhost:${basePort}`,
changeOrigin: true,
router: (req: any) => `http://localhost:${basePort + off(req)}`,
})
export default defineConfig({
plugins: [react()],
// 배포 빌드: 콘솔(index.html) + 단말(dt.html) 두 엔트리를 한 번에 dist로.
build: {
rollupOptions: {
input: { main: 'index.html', dt: 'dt.html' },
},
},
server: {
port: 5174,
proxy: {
'/accounts': routed(8091),
'/inquiry': routed(8091),
'/pay': routed(8091),
'/meta': routed(8091),
'/rawmessage': routed(8091),
'/notifications': routed(8091),
'/ledger': routed(8091),
'/admin': routed(8099),
'/console': routed(8099),
'/gucci': routed(8095),
},
},
})