Dockercommit

This commit is contained in:
mukesh13
2025-06-23 15:39:47 +05:30
parent b9e0a86037
commit 2119c55e06

View File

@ -5,11 +5,20 @@ FROM node:lts AS build
WORKDIR /app
# Set environment variables to help with sharp installation
ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1
ENV npm_config_sharp_binary_host="https://npmjs.org/mirrors/sharp"
ENV npm_config_sharp_libvips_binary_host="https://npmjs.org/mirrors/sharp-libvips"
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies with legacy peer deps to handle @reach/router conflict
RUN npm install --legacy-peer-deps
# Install dependencies with legacy peer deps and increased timeout
# Use --no-optional to skip optional dependencies that might cause issues
RUN npm config set fetch-timeout 600000 && \
npm config set fetch-retry-mintimeout 10000 && \
npm config set fetch-retry-maxtimeout 60000 && \
npm install --legacy-peer-deps --no-optional --verbose
# Copy source code
COPY . .