Skip to content

Commit

Permalink
fix : FE 웹서버 이미지 빌드 시 conf 파일 누락 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoons97 committed Jan 22, 2025
1 parent f7632a2 commit 4896702
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions FE/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ FROM node:20-alpine AS build

WORKDIR /app/

ENV VITE_BASE_URL=https://www.q-lab.site/api

COPY ./package*.json /app

RUN npm config set registry https://registry.npmjs.org/
Expand All @@ -28,6 +26,8 @@ FROM nginx:alpine

COPY --from=build /app/FE/dist /usr/share/nginx/html

COPY ./FE/conf/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
9 changes: 6 additions & 3 deletions FE/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
server {
listen 80;
server_name q-lab.site www.q-lab.site;
server_name _;


# 정적 파일 serve
location / {
try_files $uri /index.html;
root /usr/share/nginx/html;
index index.html;
}


# 네스트 서비스 서버로 라우팅
location /api/ {
proxy_pass http://apiserver-service.default:3000/;
proxy_pass http://apiserver-service:3000/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
2 changes: 1 addition & 1 deletion FE/src/api/axiosClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'

const axiosClient = axios.create({
baseURL: import.meta.env.VITE_BASE_URL,
baseURL: `${window.location.origin}/api`,
headers: {
'Content-Type': 'application/json',
},
Expand Down

0 comments on commit 4896702

Please sign in to comment.