diff --git a/Dockerfile b/Dockerfile index c391369..abb7d9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ # Stage 1: Build the React Application -FROM node:20-alpine AS builder +FROM node:20-slim AS builder WORKDIR /app -# Copy package.json to install dependencies first (better caching) -COPY package.json ./ +# Copy package.json (and lock file if it exists) to install dependencies first +COPY package*.json ./ # Install all dependencies (including devDependencies for the build process) RUN npm install @@ -16,12 +16,12 @@ COPY . . RUN npm run build # Stage 2: Setup the Production Server (Node.js) -FROM node:20-alpine +FROM node:20-slim WORKDIR /app # Copy package.json again for production dependencies -COPY package.json ./ +COPY package*.json ./ # Install ONLY production dependencies (skips devDependencies like Vite/Typescript) RUN npm install --omit=dev