Skip to content

Commit e6ba85f

Browse files
committed
chore: 환경변수 설정 변경
1 parent 0303856 commit e6ba85f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
password: ${{secrets.DOCKERHUB_TOKEN}} # 도커 허브 access token
1616
- name: Build and Release
1717
run: |
18-
docker build -t ${{secrets.DOCKERHUB_REPO}} .
18+
docker build \
19+
--build-arg VITE_API_URL=${{ secrets.VITE_API_URL }} \
20+
-t ${{secrets.DOCKERHUB_REPO}} .
1921
docker tag ${{secrets.DOCKERHUB_REPO}}:latest ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
2022
docker push ${{secrets.DOCKERHUB_USERNAME}}/${{secrets.DOCKERHUB_REPO}}:latest
2123
- name: Deploy to server

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ RUN npm ci
1313
# 소스 코드 복사
1414
COPY . .
1515

16+
# build-time ARG 정의
17+
ARG VITE_API_URL
18+
ENV VITE_API_URL=$VITE_API_URL
19+
1620
# Vite로 빌드
21+
RUN echo "VITE_API_URL=$VITE_API_URL"
1722
RUN npm run build
1823

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

0 commit comments

Comments
 (0)