build(frontend): update docker image to use production env
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
# --- Build stage ---
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci
|
||||
|
||||
COPY . .
|
||||
EXPOSE 5173
|
||||
CMD ["npm", "run", "dev"]
|
||||
RUN npm run build
|
||||
|
||||
# --- Production stage ---
|
||||
FROM nginx:1.27-alpine AS prod
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user