c00d002972
Root had accumulated files that should never have been tracked:
- Committed build output: TaxBaik.Web.*.json (runtimeconfig/deps), and a
225-file root wwwroot/ that duplicated (and was staler than)
TaxBaik.Web/wwwroot/.
- A stale migrations/ (V001-V003 only) superseded by db/migrations/, which
is the directory MigrationRunner and CI actually use.
- An orphaned root appsettings.json (dev DB password + JWT secret) that the
app's content root (TaxBaik.Web/) never actually loads.
- Ad-hoc debug/log scratch files: debug-settings.js, final-test.js,
test-settings.js, settings-page.png, login-test-output.log,
server.{err,out}.log.
- docker-compose.yml, Dockerfile.*, web.config, SERVER_SETUP.sh, deploy.sh,
remote_deploy.sh - none referenced by any .gitea/workflows/*.yml; leftovers
from a Docker/manual-deploy approach superseded by deploy_gb.sh's
systemd + Green-Blue proxy model.
- Tmp/ - screenshots and a scratch html/js, exactly the "temp work
committed to root" problem.
None of this is destroyed - it stays recoverable via git history if ever
needed. Historical root-level docs (BLOG_TEMPLATE.md, DEPLOYMENT_GUIDE.md,
etc.) are moved into docs/archive/ rather than deleted, since docs/INDEX.md
already treats anything outside docs/ as non-canonical reference material.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
170 lines
3.8 KiB
Markdown
170 lines
3.8 KiB
Markdown
# Docker로 TaxBaik 로컬 실행하기
|
|
|
|
## 1. 사전 요구사항
|
|
|
|
- Docker Desktop 설치
|
|
- Docker Compose 설치
|
|
- 4GB+ 메모리 여유
|
|
|
|
## 2. 빌드 및 실행
|
|
|
|
```bash
|
|
# 1단계: 빌드 (이미 완료됨)
|
|
cd C:\Temp\taxbaik
|
|
dotnet publish TaxBaik.Web -c Release -o ./publish/web
|
|
|
|
# 2단계: Docker Compose 실행
|
|
docker-compose up -d
|
|
|
|
# 3단계: 상태 확인
|
|
docker-compose ps
|
|
```
|
|
|
|
## 3. 접근 방법
|
|
|
|
### 공개 사이트 (Razor Pages)
|
|
- **URL**: http://localhost:5001/taxbaik
|
|
- **기능**:
|
|
- 홈페이지 보기
|
|
- 블로그 검색
|
|
- 상담 신청 폼
|
|
|
|
### 관리자 백오피스 (Blazor Server)
|
|
- **URL**: http://localhost:5001/taxbaik/admin/login
|
|
- **초기 계정**:
|
|
- username: `admin`
|
|
- password: `<TAXBAIK_ADMIN_TEST_PASSWORD>`
|
|
- **기능**:
|
|
- 대시보드 확인
|
|
- 블로그 관리
|
|
- 문의 조회
|
|
|
|
## 4. 데이터베이스 접근
|
|
|
|
### PostgreSQL CLI 접속
|
|
```bash
|
|
docker-compose exec postgres psql -U taxbaik -d taxbaikdb
|
|
```
|
|
|
|
### 쿼리 예시
|
|
```sql
|
|
-- 테이블 확인
|
|
\dt
|
|
|
|
-- 마이그레이션 확인
|
|
SELECT * FROM schema_migrations;
|
|
|
|
-- 블로그 포스트 확인
|
|
SELECT id, title, is_published FROM blog_posts;
|
|
|
|
-- 문의 확인
|
|
SELECT id, name, phone, status FROM inquiries;
|
|
|
|
-- 관리자 확인
|
|
SELECT username FROM admin_users;
|
|
```
|
|
|
|
## 5. 로그 확인
|
|
|
|
```bash
|
|
# Web 앱 로그
|
|
docker-compose logs -f taxbaik-web
|
|
|
|
# 데이터베이스 로그
|
|
docker-compose logs -f postgres
|
|
```
|
|
|
|
## 6. E2E 테스트
|
|
|
|
### 6.1 공개 사이트 테스트
|
|
```bash
|
|
# 홈페이지 접근
|
|
curl -I http://localhost:5001/taxbaik/
|
|
# 예상: 200 OK
|
|
|
|
# 블로그 목록
|
|
curl http://localhost:5001/taxbaik/blog | grep -o "title>[^<]*" | head -5
|
|
|
|
# 블로그 상세 (accountant-mistakes-5)
|
|
curl http://localhost:5001/taxbaik/blog/accountant-mistakes-5 | grep -o "og:title[^>]*"
|
|
```
|
|
|
|
### 6.2 문의 폼 제출 테스트
|
|
```bash
|
|
curl -X POST http://localhost:5001/taxbaik/contact \
|
|
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
-d "name=테스트&phone=010-1234-5678&service_type=사업자세무&message=테스트 문의&__RequestVerificationToken="
|
|
```
|
|
|
|
### 6.3 관리자 테스트
|
|
```bash
|
|
# 로그인 페이지
|
|
curl -I http://localhost:5001/taxbaik/admin/login
|
|
# 예상: 200 OK
|
|
|
|
# 로그인 (쿠키 저장)
|
|
curl -c cookies.txt -X POST http://localhost:5001/taxbaik/admin/login \
|
|
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
-d "username=admin&password=<TAXBAIK_ADMIN_TEST_PASSWORD>"
|
|
|
|
# 대시보드 접근 (쿠키 사용)
|
|
curl -b cookies.txt http://localhost:5001/taxbaik/admin/dashboard
|
|
```
|
|
|
|
## 7. 종료 및 정리
|
|
|
|
```bash
|
|
# 컨테이너 중지
|
|
docker-compose down
|
|
|
|
# 볼륨 포함 삭제 (데이터베이스 초기화)
|
|
docker-compose down -v
|
|
|
|
# 이미지 삭제
|
|
docker rmi taxbaik-web
|
|
```
|
|
|
|
## 8. 트러블슈팅
|
|
|
|
| 문제 | 해결 방법 |
|
|
|------|----------|
|
|
| 포트 5001 사용 중 | `netstat -ano \| findstr :5001` 후 프로세스 종료 |
|
|
| 데이터베이스 연결 실패 | `docker-compose logs postgres` 로그 확인 |
|
|
| 마이그레이션 오류 | `docker-compose down -v` 후 재시작 |
|
|
| 메모리 부족 | Docker Desktop 설정에서 메모리 증가 |
|
|
|
|
## 9. 성능 모니터링
|
|
|
|
```bash
|
|
# 컨테이너 리소스 사용량
|
|
docker stats
|
|
|
|
# 네트워크 확인
|
|
docker network ls
|
|
docker network inspect taxbaik_default
|
|
```
|
|
|
|
## 10. 데이터 검증
|
|
|
|
### 초기 데이터 확인
|
|
```bash
|
|
# 카테고리
|
|
docker-compose exec postgres psql -U taxbaik -d taxbaikdb \
|
|
-c "SELECT * FROM categories;"
|
|
|
|
# 블로그 포스트
|
|
docker-compose exec postgres psql -U taxbaik -d taxbaikdb \
|
|
-c "SELECT title, is_published FROM blog_posts;"
|
|
|
|
# 관리자
|
|
docker-compose exec postgres psql -U taxbaik -d taxbaikdb \
|
|
-c "SELECT username FROM admin_users;"
|
|
```
|
|
|
|
---
|
|
|
|
**상태 확인 URL**:
|
|
- 공개 사이트: http://localhost:5001/taxbaik
|
|
- 관리자: http://localhost:5001/taxbaik/admin/login
|
|
- 데이터베이스: localhost:5432
|