From 601f80ab068439c94b012cc21f525ca8823d44bc Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Wed, 21 Jan 2026 19:45:47 +0100 Subject: [PATCH] Fix Docker build - add React build step back to Dockerfile The build/ directory doesn't exist in Docker context, so we need to build the React app inside the container. This approach: - Installs all deps, builds app, then removes dev deps - Works for remote deployments without requiring pre-built artifacts - Maintains lean final image size --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 177c6e7..2009612 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,14 +7,19 @@ WORKDIR /app # Copy package files COPY package*.json ./ -# Install dependencies (production only) -RUN npm ci --only=production +# Install dependencies (production + dev for build) +RUN npm ci -# Copy server code +# Copy source code +COPY src/ ./src/ +COPY public/ ./public/ COPY server.js ./server.js -# Copy built application -COPY build/ ./build/ +# Build the application +RUN npm run build + +# Remove dev dependencies to reduce image size +RUN npm ci --only=production && npm cache clean --force # Expose port 3000 EXPOSE 3000