From 24e673de737caa809ea3244de7b00eea81ba180b Mon Sep 17 00:00:00 2001 From: stabgan Date: Wed, 26 Mar 2025 23:16:06 +0530 Subject: [PATCH] Fix: Update Docker build process to resolve npm install failures --- .github/workflows/docker-publish.yml | 1 + Dockerfile | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 742bcc2..c956605 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,6 +60,7 @@ jobs: build-args: | NPM_CONFIG_STRICT_SSL=false NPM_CONFIG_REGISTRY=https://registry.npmjs.org/ + NODE_ENV=development publish-npm: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index c61a2fd..caa0723 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,12 @@ RUN apk add --no-cache \ RUN npm config set strict-ssl false RUN npm config set registry https://registry.npmjs.org/ -# Copy package files and install dependencies +# Copy package files 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 . . @@ -22,7 +25,7 @@ COPY . . # Build TypeScript code RUN npm run build -# Default environment variables +# Switch to production for runtime ENV NODE_ENV=production # The API key should be passed at runtime