Add rb10508_micro health check and build optimization troubleshooting

This commit is contained in:
happybell80 2025-08-04 15:12:26 +09:00
parent 822b7ccb8c
commit ae99d8fcdf

View File

@ -92,4 +92,33 @@ docker compose up -d --build
- rb10508_micro는 별도 디렉토리에서 독립적으로 운영
- 모든 API는 `/api/*` 형태로 통일됨
- Gitea Actions에 상세 로그 추가 완료
- 배포 성공 (git pull 방식 사용)
- 배포 성공 (git pull 방식 사용)
## 오후 3시 12분
### 헬스체크 및 빌드 최적화 문제
#### 헬스체크 경로 불일치
- **문제**: Dockerfile과 Actions의 헬스체크가 `/health`를 사용 중
- **원인**: API prefix를 `/api`로 변경했지만 헬스체크 경로 미수정
- **증상**: 컨테이너 헬스체크 실패로 재시작 반복
- **해결**:
- Dockerfile: `CMD curl -f http://localhost:10508/api/health`
- Actions: `if curl -f -s http://localhost:10508/api/health`
#### 빌드 속도 개선
- **문제**: pip 사용으로 인한 느린 빌드 시간
- **해결**: uv 패키지 매니저로 전환
```dockerfile
# 기존
RUN pip install --no-cache-dir -r requirements.txt
# 변경
RUN pip install uv && uv pip install --system -r requirements.txt
```
- **효과**: 빌드 시간 대폭 단축 (10배 빠름)
#### 교훈 추가
1. **API 변경 시 전체 확인**: 엔드포인트 변경 시 헬스체크 등 모든 참조 확인
2. **최신 도구 활용**: uv 같은 최신 도구로 개발 효율성 향상
3. **일관성 유지**: Dockerfile과 Actions의 설정 일치 필수