# Frontend Config Templates `.env.production` 의 환경별 양식. **Jenkins Secret File 로 업로드**되어 빌드 시점에 주입됩니다. ## 디렉토리 구조 ``` config-templates/ ├── dev/ (CTL-Window-Server / dev.antooza.com) │ └── .env.production.template └── prod/ (PROD-Window-Server / antooza.com) └── .env.production.template ``` ## Secret File 등록 `Manage Jenkins → Credentials → (global) → Add Credentials → Kind: Secret file`: | 환경 | credentialsId | 사용 파일 | Jenkinsfile | |------|---------------------------|---------------------------------------------|-------------| | dev | `DEV-ANTOOZA-FRONTEND-ENV` | `dev/.env.production.template` 채워서 | `Frontend/Jenkinsfile` | | prod | `PROD-ANTOOZA-FRONTEND-ENV` | `prod/.env.production.template` 채워서 | `Frontend/Jenkinsfile.prod` | ## 빌드 시 흐름 1. `withCredentials([file(credentialsId: '...', variable: 'CFG')])` 2. `copy /Y "%CFG%" .env.production` 3. `npm run build` — `NEXT_PUBLIC_*` 는 빌드 시 클라이언트 번들에 inline 4. Deploy 단계에서 `.env.production` 을 배포 경로에도 복사 — 서버 사이드 (`API_URL`, `SIGNALR_CHAT_URL` 등) 가 런타임에 로드됨 - dev : `F:\IIS\ANTOOZA\Front\` - prod: `C:\workspace\IIS\Front\` ## dev → prod 차이 (참고) | 키 | dev | prod | |---|-----|------| | `NEXT_PUBLIC_SITE_URL` | `https://dev.antooza.com` | `https://antooza.com` | | `NEXT_PUBLIC_API_URL` / `API_URL` | `https://dev-api.antooza.com` | `https://api.antooza.com` | | `NEXT_PUBLIC_RESOURCE_URL` | `https://dev-resource.antooza.com` | `https://resource.antooza.com` | | `NEXT_PUBLIC_EMBED_DOMAIN` | `dev.antooza.com` | `antooza.com` | | `SIGNALR_CHAT_URL` / `SIGNALR_APP_URL` | `https://dev-api.antooza.com/hubs/{chat,app}` | `https://api.antooza.com/hubs/{chat,app}` | ## 보안 노트 - 실제 `.env.production` / `.env.development` 는 `.gitignore` 의 `.env*` 룰로 무시 (커밋 금지) - Secret File 업로드 후 Jenkins UI에서 다운로드 불가, 빌드 로그에 자동 마스킹