This commit is contained in:
+11
-33
@@ -27,21 +27,12 @@ Environment=ASPNETCORE_URLS=http://127.0.0.1:5001
|
||||
Environment=ConnectionStrings__Default=Host=localhost;Database=taxbaikdb;Username=taxbaik;Password=your_secure_password
|
||||
```
|
||||
|
||||
**Admin 서비스** (`/etc/systemd/system/taxbaik-admin.service`):
|
||||
```ini
|
||||
[Service]
|
||||
Environment=ASPNETCORE_ENVIRONMENT=Production
|
||||
Environment=ASPNETCORE_URLS=http://127.0.0.1:5002
|
||||
Environment=ConnectionStrings__Default=Host=localhost;Database=taxbaikdb;Username=taxbaik;Password=your_secure_password
|
||||
```
|
||||
|
||||
### 3. systemd 서비스 파일 설치
|
||||
|
||||
```bash
|
||||
sudo cp deploy/taxbaik.service /etc/systemd/system/
|
||||
sudo cp deploy/taxbaik-admin.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable taxbaik taxbaik-admin
|
||||
sudo systemctl enable taxbaik
|
||||
```
|
||||
|
||||
### 4. Nginx 설정
|
||||
@@ -69,27 +60,10 @@ sudo systemctl reload nginx
|
||||
|
||||
2. 배포 워크플로우는 자동으로 실행:
|
||||
```
|
||||
master 브랜치 push → build → publish → rsync → restart
|
||||
master 브랜치 push → build → publish → restart
|
||||
```
|
||||
|
||||
### 수동 배포 (필요시)
|
||||
|
||||
```bash
|
||||
# 로컬에서 빌드
|
||||
dotnet publish TaxBaik.sln -c Release -o ./publish
|
||||
|
||||
# 서버에 배포
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
rsync -az ./publish/web/ kjh2064@178.104.200.7:~/deployments/taxbaik_${TIMESTAMP}/
|
||||
rsync -az ./publish/admin/ kjh2064@178.104.200.7:~/deployments/taxbaik_admin_${TIMESTAMP}/
|
||||
|
||||
# 서버에서 심링크 변경 및 재시작
|
||||
ssh kjh2064@178.104.200.7 << EOF
|
||||
ln -sfn ~/deployments/taxbaik_${TIMESTAMP} ~/taxbaik_active
|
||||
ln -sfn ~/deployments/taxbaik_admin_${TIMESTAMP} ~/taxbaik_admin_active
|
||||
sudo systemctl restart taxbaik taxbaik-admin
|
||||
EOF
|
||||
```
|
||||
수동 배포는 사용하지 않습니다. 배포 이슈는 Gitea Actions 로그로 해결합니다.
|
||||
|
||||
## 마이그레이션 자동 실행
|
||||
|
||||
@@ -102,7 +76,6 @@ EOF
|
||||
로그 확인:
|
||||
```bash
|
||||
journalctl -u taxbaik -n 50
|
||||
journalctl -u taxbaik-admin -n 50
|
||||
```
|
||||
|
||||
## 검증
|
||||
@@ -116,6 +89,11 @@ curl -I http://178.104.200.7/taxbaik/
|
||||
# 관리자 로그인 페이지
|
||||
curl -I http://178.104.200.7/taxbaik/admin/login
|
||||
|
||||
# 로그인 API 확인
|
||||
curl -X POST http://178.104.200.7/taxbaik/api/auth/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"admin","password":"admin123"}'
|
||||
|
||||
# 문의 폼 제출 테스트
|
||||
curl -X POST http://178.104.200.7/taxbaik/contact \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
@@ -158,10 +136,10 @@ sudo systemctl restart taxbaik
|
||||
ssh kjh2064@178.104.200.7
|
||||
|
||||
# 서비스 상태
|
||||
systemctl status taxbaik taxbaik-admin
|
||||
systemctl status taxbaik
|
||||
|
||||
# 포트 확인
|
||||
netstat -tlnp | grep -E '5001|5002'
|
||||
netstat -tlnp | grep -E '5001'
|
||||
|
||||
# 프로세스 확인
|
||||
ps aux | grep TaxBaik
|
||||
@@ -175,7 +153,7 @@ tail -f /var/log/nginx/access.log | grep taxbaik
|
||||
|
||||
# 애플리케이션 로그
|
||||
journalctl -u taxbaik -f
|
||||
journalctl -u taxbaik-admin -f
|
||||
journalctl -u taxbaik -f
|
||||
```
|
||||
|
||||
## 트러블슈팅
|
||||
|
||||
Reference in New Issue
Block a user