- Add GitHub Actions CI/CD pipeline - Configure Nginx reverse proxy for robeing services - Setup docker-compose for full stack deployment - Include health checks for all services - Support for PostgreSQL and Redis data persistence 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
68 lines
1.7 KiB
Markdown
68 lines
1.7 KiB
Markdown
# 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 패스워드 또는 토큰
|
|
```
|
|
|
|
### 환경 변수 설정
|
|
```bash
|
|
# .env 파일 생성
|
|
DATABASE_URL=postgresql://user:password@postgres:5432/robeing
|
|
REDIS_URL=redis://redis:6379/0
|
|
POSTGRES_USER=robeing
|
|
POSTGRES_PASSWORD=your-secure-password
|
|
```
|
|
|
|
## 배포 방법
|
|
|
|
### 개발 환경
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
### 프로덕션 배포
|
|
```bash
|
|
# 환경 변수 설정 후
|
|
docker-compose -f docker-compose.yml up -d
|
|
```
|
|
|
|
## 서비스 구성
|
|
|
|
- **nginx**: 리버스 프록시 (포트 80, 443)
|
|
- **api-base**: API 서버 (포트 8000)
|
|
- **test_api**: 테스트 API 서버 (포트 8001)
|
|
- **frontend**: 프론트엔드 서버 (포트 5173)
|
|
- **postgres**: PostgreSQL 데이터베이스
|
|
- **redis**: Redis 캐시
|
|
|
|
## Health Check
|
|
|
|
모든 서비스는 health check가 설정되어 있으며, `/health` 엔드포인트로 상태 확인 가능합니다.
|
|
|
|
```bash
|
|
curl http://localhost/health
|
|
``` |