Fix: Update Docker build process to resolve npm install failures

This commit is contained in:
stabgan
2025-03-26 23:16:06 +05:30
parent d02e0a9299
commit 24e673de73
2 changed files with 7 additions and 3 deletions

View File

@@ -60,6 +60,7 @@ jobs:
build-args: | build-args: |
NPM_CONFIG_STRICT_SSL=false NPM_CONFIG_STRICT_SSL=false
NPM_CONFIG_REGISTRY=https://registry.npmjs.org/ NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
NODE_ENV=development
publish-npm: publish-npm:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -12,9 +12,12 @@ RUN apk add --no-cache \
RUN npm config set strict-ssl false RUN npm config set strict-ssl false
RUN npm config set registry https://registry.npmjs.org/ RUN npm config set registry https://registry.npmjs.org/
# Copy package files and install dependencies # Copy package files
COPY package*.json ./ COPY package*.json ./
RUN npm ci
# Install dependencies with development environment for building
ENV NODE_ENV=development
RUN npm ci --no-optional --unsafe-perm
# Copy source code # Copy source code
COPY . . COPY . .
@@ -22,7 +25,7 @@ COPY . .
# Build TypeScript code # Build TypeScript code
RUN npm run build RUN npm run build
# Default environment variables # Switch to production for runtime
ENV NODE_ENV=production ENV NODE_ENV=production
# The API key should be passed at runtime # The API key should be passed at runtime