ci: 빌드 시 VITE_API_BASE_URL을 build arg로 주입
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
Vite는 빌드 타임에 환경변수를 번들에 포함하므로 서버 secrets에서 VITE_API_BASE_URL을 받아 docker build 시 전달 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ jobs:
|
||||
rm -rf a301-client
|
||||
git clone https://tolelom:${{ secrets.GIT_TOKEN }}@git.tolelom.xyz/A301/a301_client.git a301-client
|
||||
cd a301-client
|
||||
docker build --no-cache -t a301-client:latest .
|
||||
docker build --no-cache --build-arg VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }} -t a301-client:latest .
|
||||
cd ~/server
|
||||
docker compose up -d --force-recreate a301-client
|
||||
rm -rf /tmp/a301-client
|
||||
|
||||
@@ -4,6 +4,8 @@ WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --legacy-peer-deps
|
||||
COPY . .
|
||||
ARG VITE_API_BASE_URL
|
||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Serve with Nginx
|
||||
@@ -11,4 +13,4 @@ FROM nginx:alpine
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user