diff --git a/docker/prod/frontend.Dockerfile b/docker/prod/frontend.Dockerfile index c3703011..17df01e2 100644 --- a/docker/prod/frontend.Dockerfile +++ b/docker/prod/frontend.Dockerfile @@ -22,6 +22,10 @@ COPY . . # Disable telemetry during the build ENV NEXT_TELEMETRY_DISABLED 1 +# 빌드 시 환경변수 설정 (ARG로 받아서 ENV로 설정) +ARG NEXT_PUBLIC_API_URL=http://192.168.0.70:8080/api +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL + # Build the application ENV DISABLE_ESLINT_PLUGIN=true RUN npm run build diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 9e986dab..286faf4a 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -41,9 +41,9 @@ const nextConfig = { ]; }, - // 환경 변수 (런타임에 읽기) - 로컬 개발환경용 + // 환경 변수 (런타임에 읽기) env: { - NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080/api", + NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || "http://192.168.0.70:8080/api", }, };