We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0df3aa commit 2649d9dCopy full SHA for 2649d9d
front/Dockerfile
@@ -0,0 +1,27 @@
1
+FROM node:20 AS build
2
+WORKDIR /app
3
+COPY package*.json ./
4
+# Install dependencies
5
+RUN npm install --legacy-peer-deps
6
+
7
+COPY . .
8
+ARG VITE_ENVIRONMENT
9
+ARG VITE_API_URL
10
11
+# Vite가 빌드 시점에 사용할 수 있도록 환경 변수 생성
12
+RUN echo "VITE_ENVIRONMENT=${VITE_ENVIRONMENT}" >> .env && \
13
+echo "VITE_API_URL=${VITE_API_URL}" >> .env
14
15
+RUN npm run build
16
17
+# Use nginx image for production stage
18
+FROM nginx:stable-alpine
19
+WORKDIR /usr/share/nginx/html
20
+RUN rm -rf ./*
21
+COPY --from=build /app/dist/ .
22
+RUN rm /etc/nginx/conf.d/default.conf
23
+COPY nginx/nginx.conf /etc/nginx/conf.d/
24
+EXPOSE 80
25
26
+# Run nginx in the foreground
27
+CMD ["nginx", "-g", "daemon off;"]
0 commit comments