Skip to content

Commit a832eb0

Browse files
Merge pull request #46 from boostcampwm-2024/Hotfix/배포_오류_해결
Hotfix/배포 시 500 에러가 발생하는 문제 해결
2 parents dab51a9 + b67c2a5 commit a832eb0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
AI_PROMPT: ${{ secrets.AI_PROMPT }}
5151
AI_API_URL: ${{ secrets.AI_API_URL }}
5252
AI_API_KEY: ${{ secrets.AI_API_KEY }}
53-
run: docker-compose build backend
53+
run: docker-compose up -d --build backend
5454

5555
deploy:
5656
name: Deploy on Server
@@ -60,13 +60,16 @@ jobs:
6060
- name: Checkout Repository
6161
uses: actions/checkout@v4
6262

63+
- name: Clean client/dist
64+
run: rm -rf client/dist
65+
6366
- name: Download client-dist
6467
uses: actions/download-artifact@v4
6568
with:
6669
name: client-dist
6770
path: client/dist
6871

69-
- name: Start Services
72+
- name: Reload Nginx
7073
env:
7174
NODE_ENV: production
7275
MONGO_URI: ${{ secrets.MONGO_URI }}
@@ -76,7 +79,7 @@ jobs:
7679
AI_PROMPT: ${{ secrets.AI_PROMPT }}
7780
AI_API_URL: ${{ secrets.AI_API_URL }}
7881
AI_API_KEY: ${{ secrets.AI_API_KEY }}
79-
run: docker-compose up -d --no-build
82+
run: docker-compose up -d --no-build --force-recreate nginx
8083

8184
- name: Cleanup
8285
run: docker image prune -f

nginx/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ server {
6363
location / {
6464
root /usr/share/nginx/html; # React 빌드 결과물이 위치한 디렉터리
6565
index index.html; # 기본 진입점 파일
66-
try_files $uri /index.html; # SPA 라우팅 지원
66+
try_files $uri $uri/ /index.html; # SPA 라우팅 지원
6767
}
6868

6969
# 404 에러 페이지 설정

0 commit comments

Comments
 (0)