Add staging environment documentation and minor fixes

- Document staging vs production DB separation (autonet_staging)
- Add staging sync and deployment commands to CLAUDE.md
- Update changelog with 2025-01-03 changes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
AutonetSellCar Deploy
2026-01-03 16:22:34 +09:00
parent 6ba254bfeb
commit 718c5b0474
5 changed files with 163 additions and 51 deletions

View File

@@ -134,6 +134,50 @@ ssh server2 "cd /opt/autonet/production/frontend && docker build --no-cache -t p
---
## Staging vs Production 환경 분리
### 데이터베이스 분리
| 환경 | DB 이름 | 용도 |
|------|---------|------|
| **Production** | `autonet` | 실서비스 데이터 |
| **Staging** | `autonet_staging` | 테스트용 데이터 (안전한 테스트) |
**DB 서버**: PostgreSQL on `192.168.0.201:5432`
### Staging 환경 설정
**Backend .env** (`/opt/autonet/staging/backend/.env`):
```env
DB_NAME=autonet_staging # Production은 autonet
```
**docker-compose.staging.yml**:
- Frontend: `NEXT_PUBLIC_API_URL=https://staging.autonetsellcar.com` (build arg)
- Backend: `.env` 파일을 볼륨 마운트로 연결
### 소스 코드 동기화
**⚠️ 중요**: Staging 디렉토리는 Git 저장소가 아님! Production과 수동 동기화 필요
```bash
# Production → Staging 소스 동기화
ssh damon@192.168.0.202 "rsync -av --exclude='node_modules' --exclude='.next' /opt/autonet/production/frontend/ /opt/autonet/staging/frontend/"
# Staging Frontend 재빌드
ssh damon@192.168.0.202 "cd /opt/autonet/staging && docker compose -f docker-compose.staging.yml build --no-cache frontend-staging && docker compose -f docker-compose.staging.yml up -d frontend-staging"
```
### Staging DB 초기 데이터 복사
```bash
# Production → Staging 데이터 복사 (psql 사용)
PGPASSWORD='roskfl@1122' pg_dump -h 192.168.0.201 -U admin -d autonet --data-only -t users -t cars -t car_images -t hero_banners | \
PGPASSWORD='roskfl@1122' psql -h 192.168.0.201 -U admin -d autonet_staging
```
---
## 1. 프로젝트 구조
```
@@ -790,6 +834,8 @@ Import 시 자동 번역 (Azure API)
| 날짜 | 변경 내용 |
|------|----------|
| 2025-01-03 | **Staging DB 분리**: `autonet_staging` DB 생성, Production/Staging 환경 완전 분리 |
| 2025-01-03 | **My Vehicles 기능**: 직접 구매 차량을 My Request 페이지에 표시 |
| 2024-12-31 | **Admin Settings 기능 추가**: Show Dealer Comment 토글, Korean Domestic + Export Customs 금액 설정 |
| 2024-12-31 | Cost 페이지에서 국내비용+수출통관비용 동적 적용 (settings API 연동) |
| 2024-12-31 | **Visitor Stats 국가별 통계 강화**: 국기 이모지 추가, 전용 Country Stats 카드 추가 |