docs: Add manual/auto deployment conflict warning
- Document git hook vs manual docker run conflict issue - Add resolution steps for container name conflicts - Reinforce: always use docker-compose for staging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
18
CLAUDE.md
18
CLAUDE.md
@@ -118,6 +118,24 @@ ssh server2 "cd /opt/autonet/staging && docker compose -f docker-compose.staging
|
||||
docker run -v /opt/autonet/staging/backend/uploads:/app/uploads ...
|
||||
```
|
||||
|
||||
### ⚠️ 수동 배포와 자동 배포(git hook) 충돌 문제 (2025-01-05 추가 사례)
|
||||
|
||||
**문제**: 수동으로 컨테이너를 만든 후 git push하면 자동 배포가 실패함
|
||||
|
||||
**원인**:
|
||||
- 수동 배포: `docker run --name autonet-frontend-staging ...` → docker-compose가 관리하지 않음
|
||||
- 자동 배포: `docker compose down` → 수동 컨테이너는 중지되지 않음
|
||||
- 자동 배포: `docker compose up` → 컨테이너 이름 충돌로 실패
|
||||
|
||||
**해결 방법**: 수동 컨테이너가 있으면 먼저 제거
|
||||
```bash
|
||||
# 충돌 시 수동 컨테이너 제거 후 docker-compose 재실행
|
||||
ssh server2 "docker stop autonet-frontend-staging autonet-backend-staging 2>/dev/null; docker rm autonet-frontend-staging autonet-backend-staging 2>/dev/null"
|
||||
ssh server2 "cd /opt/autonet/staging && docker compose -f docker-compose.staging.yml up -d"
|
||||
```
|
||||
|
||||
**예방책**: 스테이징 배포는 **항상** docker-compose만 사용하고, 수동 docker run 절대 금지!
|
||||
|
||||
## ✅ 배포 전 필수 검증 명령어
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user