From ca0f4f10b3498c468898c3e212ccae91e668c49b Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 8 Mar 2026 16:04:05 -0500 Subject: [PATCH] Simplify Dockerfile to use npm install (works without lockfiles) --- Dockerfile | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7fc2f6a..ec965bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,9 @@ WORKDIR /app/frontend # Copy frontend package files COPY frontend/package*.json ./ -# Generate lockfile if it doesn't exist, then install dependencies -RUN if [ ! -f package-lock.json ]; then \ - echo "Generating package-lock.json..."; \ - npm install --package-lock-only; \ - fi && \ - npm ci +# Install all dependencies (including devDependencies for build) +# Use npm install which works without lockfile +RUN npm install # Copy frontend source and build COPY frontend/ ./ @@ -25,12 +22,8 @@ WORKDIR /app/backend # Copy backend package files COPY backend/package*.json ./ -# Generate lockfile if it doesn't exist, then install dependencies -RUN if [ ! -f package-lock.json ]; then \ - echo "Generating package-lock.json..."; \ - npm install --package-lock-only; \ - fi && \ - npm ci +# Install all dependencies (including TypeScript) +RUN npm install # Copy backend source and compile TypeScript COPY backend/ ./ @@ -44,12 +37,8 @@ WORKDIR /app # Copy backend package files COPY backend/package*.json ./ -# Generate lockfile if it doesn't exist, then install production dependencies only -RUN if [ ! -f package-lock.json ]; then \ - echo "Generating package-lock.json..."; \ - npm install --package-lock-only; \ - fi && \ - npm ci --omit=dev && \ +# Install production dependencies only +RUN npm install --omit=dev && \ npm cache clean --force # Copy compiled backend from builder