From 8ddda5281ddb52a41fc0de367aa2a1105743287f Mon Sep 17 00:00:00 2001 From: kusuma_ari Date: Mon, 15 Dec 2025 14:20:56 +0700 Subject: [PATCH] Merge from lates --- Dockerfile | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 55d61877..e930a32a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,17 @@ -# Build Stage -FROM node:24-alpine AS build-stage - -# Set the working directory inside the container +# Build stage +FROM node:20-alpine AS build-stage WORKDIR /app -# Enable pnpm using corepack RUN corepack enable - -# Copy pnpm related files and package.json to leverage Docker layer caching COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile -# Install dependencies using pnpm -# Using --frozen-lockfile ensures consistent installations based on pnpm-lock.yaml -RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store pnpm install --frozen-lockfile - -# Copy the rest of the application files COPY . . +RUN pnpm generate -# Build the Vue.js application for production -RUN pnpm build +# Production stage +FROM nginx:stable-alpine +COPY --from=build-stage /app/.output/public /usr/share/nginx/html -# Production Stage -FROM nginx:stable-alpine AS production-stage - -# Copy the built Vue.js application from the build stage to Nginx's web root -COPY --from=build-stage /app/dist /usr/share/nginx/html - -# Expose port 80 for Nginx EXPOSE 80 - -# Command to run Nginx in the foreground CMD ["nginx", "-g", "daemon off;"]