From 65b4305f379feb5348a8872d632a3fecefe58dfc Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Mon, 22 Jun 2026 00:05:30 +0000 Subject: [PATCH] feat: update frontend Dockerfile with multi-stage build --- frontend/Dockerfile | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index d575d69..18e4f4b 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,23 +1,13 @@ -# Use Node.js 22 LTS as base image -FROM node:22-alpine - -# Set working directory +# Build stage +FROM node:22-alpine AS builder WORKDIR /app - -# Copy package files COPY package*.json ./ - -# Install dependencies RUN npm ci - -# Copy source code COPY . . - -# Build the application RUN npm run build -# Expose port 8080 -EXPOSE 8080 - -# Run the application -CMD ["npm", "run", "preview"] \ No newline at end of file +# Production stage +FROM nginx:alpine +COPY --from=builder /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file