This commit is contained in:
+4
-38
@@ -126,28 +126,23 @@ SELECT * FROM categories;
|
||||
```bash
|
||||
# 로컬에서:
|
||||
scp deploy/taxbaik.service kjh2064@178.104.200.7:~/
|
||||
scp deploy/taxbaik-admin.service kjh2064@178.104.200.7:~/
|
||||
```
|
||||
|
||||
서버에서:
|
||||
```bash
|
||||
# 파일 복사
|
||||
sudo cp ~/taxbaik.service /etc/systemd/system/
|
||||
sudo cp ~/taxbaik-admin.service /etc/systemd/system/
|
||||
|
||||
# 환경 변수 추가 (DB 연결 문자열)
|
||||
sudo nano /etc/systemd/system/taxbaik.service
|
||||
# 아래 줄을 [Service] 섹션에서 주석 해제:
|
||||
# Environment=ConnectionStrings__Default=Host=localhost;Database=taxbaikdb;Username=taxbaik;Password=your_password
|
||||
|
||||
# 같은 작업을 taxbaik-admin.service에도 반복
|
||||
|
||||
# systemd 재로드
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# 서비스 활성화 (부팅 시 자동 시작)
|
||||
sudo systemctl enable taxbaik
|
||||
sudo systemctl enable taxbaik-admin
|
||||
```
|
||||
|
||||
---
|
||||
@@ -170,24 +165,14 @@ ls -la /etc/nginx/sites-available/
|
||||
location /taxbaik {
|
||||
proxy_pass http://127.0.0.1:5001;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection keep-alive;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 120s;
|
||||
}
|
||||
|
||||
location /taxbaik/admin {
|
||||
proxy_pass http://127.0.0.1:5002;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
```
|
||||
|
||||
설정 검증 및 재로드:
|
||||
@@ -229,8 +214,6 @@ Gitea Secret 창에 전체 붙여넣기.
|
||||
```bash
|
||||
mkdir -p ~/deployments
|
||||
mkdir -p ~/taxbaik_active
|
||||
mkdir -p ~/taxbaik_admin_active
|
||||
|
||||
# 권한 확인
|
||||
ls -la ~/ | grep taxbaik
|
||||
```
|
||||
@@ -244,21 +227,8 @@ ls -la ~/ | grep taxbaik
|
||||
# 솔루션 빌드
|
||||
dotnet build TaxBaik.sln -c Release
|
||||
|
||||
# Web 앱 발행
|
||||
dotnet publish src/TaxBaik.Web/ -c Release -o ./publish/web
|
||||
|
||||
# 서버에 배포
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
rsync -az ./publish/web/ kjh2064@178.104.200.7:~/deployments/taxbaik_$TIMESTAMP/
|
||||
|
||||
# 서버에서 심링크 설정
|
||||
ssh kjh2064@178.104.200.7 "ln -sfn ~/deployments/taxbaik_$TIMESTAMP ~/taxbaik_active"
|
||||
|
||||
# 서비스 시작
|
||||
ssh kjh2064@178.104.200.7 "sudo systemctl start taxbaik"
|
||||
|
||||
# 확인
|
||||
curl http://178.104.200.7/taxbaik
|
||||
# 배포는 Gitea Actions가 처리
|
||||
# 수동 publish/rsync 절차는 사용하지 않음
|
||||
```
|
||||
|
||||
---
|
||||
@@ -274,18 +244,14 @@ psql -U taxbaik -d taxbaikdb -c "\dt"
|
||||
|
||||
# 2. 서비스 상태
|
||||
sudo systemctl status taxbaik
|
||||
sudo systemctl status taxbaik-admin
|
||||
|
||||
# 3. Nginx 로그 확인
|
||||
sudo tail -f /var/log/nginx/error.log
|
||||
|
||||
# 4. 앱 로그 확인
|
||||
journalctl -u taxbaik -n 50
|
||||
journalctl -u taxbaik-admin -n 50
|
||||
|
||||
# 5. 엔드포인트 테스트
|
||||
curl -v http://127.0.0.1:5001/health
|
||||
curl -v http://127.0.0.1:5002/health
|
||||
curl -v http://127.0.0.1/taxbaik
|
||||
|
||||
# 6. 문의 폼 E2E 테스트
|
||||
|
||||
Reference in New Issue
Block a user