nginx-infra/README.md
happybell80 c09ba6a017 feat: Ubuntu 서버용 심플 nginx 배포 시스템 구축
- GitHub Actions를 심플하게 재구성 (불필요한 테스트 로그 제거)
- SSL 자동 설정 (Let's Encrypt)
- 프록시 라우팅 업데이트: /api/ → 18000, /rb8001/ → 8001
- 배포 경로: /opt/robeing-nginx

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 14:20:26 +09:00

1.8 KiB

Nginx Deploy - Robeing Project

GitOps 방식으로 관리되는 Robeing 프로젝트의 배포 매니페스트 저장소입니다.

구조

nginx-deploy/
├── .github/workflows/deploy.yml  # GitHub Actions CI/CD
├── nginx/
│   ├── nginx.conf                # Nginx 설정
│   └── Dockerfile                # Nginx 컨테이너 빌드
└── docker-compose.yml            # 전체 서비스 정의

배포 플로우

  1. 애플리케이션 저장소에서 코드 변경 시
  2. GitHub Actions가 새 이미지 빌드 후 Docker Hub에 push
  3. Webhook으로 이 저장소의 docker-compose.yml 업데이트
  4. 수동 또는 자동으로 서버에 배포

설정

GitHub Secrets 설정

DOCKER_USERNAME: Docker Hub 사용자명
DOCKER_PASSWORD: Docker Hub 패스워드 또는 토큰

환경 변수 설정

# .env 파일 생성
DATABASE_URL=postgresql://user:password@postgres:5432/robeing
REDIS_URL=redis://redis:6379/0
POSTGRES_USER=robeing
POSTGRES_PASSWORD=your-secure-password

배포 방법

개발 환경

docker-compose up -d

프로덕션 배포

# 환경 변수 설정 후
docker-compose -f docker-compose.yml up -d

서비스 구성

  • nginx: 리버스 프록시 (포트 80, 443)
  • frontend/backend: 통합 서버 (포트 18000)
  • api_base: API 서버 (포트 8001)

프록시 라우팅

  • https://ro-being.com/ → 192.168.219.45:5173 (메인 프론트엔드)
  • https://ro-being.com/api/ → 192.168.219.45:18000 (frontend/backend)
  • https://ro-being.com/rb8001/ → 192.168.219.45:8001 (api_base)

Health Check

모든 서비스는 health check가 설정되어 있으며, /health 엔드포인트로 상태 확인 가능합니다.

curl http://localhost/health