Add deployment workflow section to CLAUDE.md
- Add staging/production server URLs - Add step-by-step deployment order (staging first!) - Add Git repository info - Add staging and production deployment commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
73
CLAUDE.md
73
CLAUDE.md
@@ -61,6 +61,79 @@ ssh server2 "docker stop autonet-frontend 2>/dev/null; docker rm autonet-fronten
|
||||
|
||||
---
|
||||
|
||||
## 🚀 배포 워크플로우 (필수!)
|
||||
|
||||
### 서버 구성
|
||||
|
||||
| 환경 | URL | 용도 |
|
||||
|------|-----|------|
|
||||
| **스테이징** | https://staging.autonetsellcar.com | 테스트용 (먼저 배포) |
|
||||
| **프로덕션** | https://autonetsellcar.com | 실서비스 (테스트 후 배포) |
|
||||
|
||||
### 배포 순서 (반드시 준수!)
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ 1. 개발 PC에서 코드 수정 │
|
||||
│ D:\Workspace\claudeCode\AutonetSellCar.com\ │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ 2. Git 커밋 및 푸시 │
|
||||
│ git add . │
|
||||
│ git commit -m "변경 내용" │
|
||||
│ git push staging main │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ 3. 스테이징 서버 배포 │
|
||||
│ - /opt/autonet/staging/frontend 에서 빌드 │
|
||||
│ - https://staging.autonetsellcar.com 에서 테스트 │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ 4. 스테이징에서 충분히 테스트 후 → 프로덕션 배포 │
|
||||
│ - /opt/autonet/production/frontend 에서 빌드 │
|
||||
│ - https://autonetsellcar.com 확인 │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Git 저장소 정보
|
||||
|
||||
| 항목 | 값 |
|
||||
|------|-----|
|
||||
| 원격 저장소 | `ssh://damon@192.168.0.202/opt/autonet/git/autonet.git` |
|
||||
| 브랜치 | `main` |
|
||||
| 원격 이름 | `staging` |
|
||||
|
||||
### 스테이징 배포 명령어
|
||||
|
||||
```bash
|
||||
# 1. 소스 동기화
|
||||
scp -r frontend/src damon@192.168.0.202:/opt/autonet/staging/frontend/
|
||||
|
||||
# 2. .env.production 설정
|
||||
ssh server2 "echo 'NEXT_PUBLIC_API_URL=https://staging.autonetsellcar.com' > /opt/autonet/staging/frontend/.env.production"
|
||||
|
||||
# 3. Docker 빌드 및 재시작
|
||||
ssh server2 "cd /opt/autonet/staging/frontend && docker build --no-cache -t staging-frontend . && docker stop autonet-frontend-staging; docker rm autonet-frontend-staging; docker run -d --name autonet-frontend-staging --restart unless-stopped -p 3001:3000 staging-frontend"
|
||||
```
|
||||
|
||||
### 프로덕션 배포 명령어
|
||||
|
||||
```bash
|
||||
# 1. 소스 동기화
|
||||
scp -r frontend/src damon@192.168.0.202:/opt/autonet/production/frontend/
|
||||
|
||||
# 2. .env.production 설정 (HTTPS 필수!)
|
||||
ssh server2 "echo 'NEXT_PUBLIC_API_URL=https://autonetsellcar.com' > /opt/autonet/production/frontend/.env.production"
|
||||
|
||||
# 3. Docker 빌드 및 재시작
|
||||
ssh server2 "cd /opt/autonet/production/frontend && docker build --no-cache -t production-frontend . && docker stop autonet-frontend; docker rm autonet-frontend; docker run -d --name autonet-frontend --restart unless-stopped -p 3000:3000 production-frontend"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 1. 프로젝트 구조
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user