Skip to content

Commit 7f5ebb4

Browse files
committed
chore: NODE_ENV 환경변수명 변경
1 parent d04635c commit 7f5ebb4

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
docker build \
1919
--build-arg VITE_API_URL=${{ secrets.VITE_API_URL }} \
20-
--build-arg NODE_ENV=${{ secrets.NODE_ENV }} \
20+
--build-arg VITE_NODE_ENV=${{ secrets.VITE_NODE_ENV }} \
2121
-t ${{secrets.DOCKERHUB_REPO}} .
2222
docker tag ${{secrets.DOCKERHUB_REPO}}:latest ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
2323
docker push ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
@@ -33,7 +33,7 @@ jobs:
3333
sudo docker pull ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
3434
sudo docker run \
3535
-e VITE_API_URL=${{ secrets.VITE_API_URL }} \
36-
-e NODE_ENV=${{ secrets.NODE_ENV }} \
36+
-e VITE_NODE_ENV=${{ secrets.VITE_NODE_ENV }} \
3737
-v /etc/letsencrypt:/etc/letsencrypt:ro \
3838
-d -p 80:80 -p 443:443 \
3939
--name ${{secrets.DOCKERHUB_REPO}} \

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ COPY . .
1515

1616
# build-time ARG 정의
1717
ARG VITE_API_URL
18-
ARG NODE_ENV
18+
ARG VITE_NODE_ENV
1919

2020
ENV VITE_API_URL=$VITE_API_URL
21-
ENV NODE_ENV=$NODE_ENV
21+
ENV VITE_NODE_ENV=$VITE_NODE_ENV
2222

2323
# Vite로 빌드
24-
RUN echo "VITE_API_URL=$VITE_API_URL"
25-
RUN echo "NODE_ENV=$NODE_ENV"
2624
RUN npm run build
2725

2826
# 2단계: 프로덕션 스테이지

src/utils/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import apiClient from './axiosConfig';
33
import { AxiosResponse } from 'axios';
44

5-
const { NODE_ENV } = import.meta.env;
6-
const apiUrl = NODE_ENV === 'prod' ? 'https://cs25.co.kr/api' : 'http://localhost:8080';
5+
const { VITE_NODE_ENV } = import.meta.env;
6+
const apiUrl = VITE_NODE_ENV === 'prod' ? 'https://cs25.co.kr/api' : 'http://localhost:8080';
77

88
// Axios wrapper for consistency with existing code
99
async function apiRequest<T>(

src/utils/axiosConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios, { AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
22

3-
const { NODE_ENV } = import.meta.env;
4-
const API_BASE_URL = NODE_ENV === 'prod' ? 'https://cs25.co.kr/api' : 'http://localhost:8080';
3+
const { VITE_NODE_ENV } = import.meta.env;
4+
const API_BASE_URL = VITE_NODE_ENV === 'prod' ? 'https://cs25.co.kr/api' : 'http://localhost:8080';
55

66
// Create axios instance for authenticated requests
77
const apiClient: AxiosInstance = axios.create({

0 commit comments

Comments
 (0)