Simplify Dockerfile to use npm install (works without lockfiles)

This commit is contained in:
2026-03-08 16:04:05 -05:00
parent 27780c36c1
commit ca0f4f10b3

View File

@@ -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