From 25fcaec204765205a2436db42784cd926c7bcf47 Mon Sep 17 00:00:00 2001 From: pulipakaa24 Date: Fri, 10 Apr 2026 00:38:47 -0500 Subject: [PATCH] npm install in dockerfile --- .gitea/workflows/deploy.yaml | 7 ------- Dockerfile.backend | 8 ++++---- Dockerfile.frontend | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index d8515bb..110a020 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -41,13 +41,6 @@ jobs: # Note: Changed 'onedev' to 'origin'. Update if your Gitea remote is named differently. git pull origin main - npm install - npm audit fix - cd server - npm install - npm audit fix - cd .. - echo "==> Running Build..." # If this build fails, 'set -e' aborts the script instantly. # Your existing containers will NOT be touched, keeping the site up. diff --git a/Dockerfile.backend b/Dockerfile.backend index 64145a6..4c4c9ae 100644 --- a/Dockerfile.backend +++ b/Dockerfile.backend @@ -1,8 +1,8 @@ # ---- Build stage ---- FROM node:22-alpine AS builder WORKDIR /app -COPY server/package.json server/package-lock.json ./ -RUN npm ci +COPY server/package.json server/package-lock.json* ./ +RUN npm install && npm audit fix COPY server/src ./src COPY server/tsconfig.json ./ RUN npm run build @@ -11,7 +11,7 @@ RUN npm run build FROM node:22-alpine WORKDIR /app COPY --from=builder /app/dist ./dist -COPY server/package.json server/package-lock.json ./ -RUN npm ci --omit=dev +COPY server/package.json server/package-lock.json* ./ +RUN npm install --omit=dev EXPOSE 3001 CMD ["node", "dist/index.js"] diff --git a/Dockerfile.frontend b/Dockerfile.frontend index ff5ac17..f8f62d1 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -1,8 +1,8 @@ # ---- Build stage ---- FROM node:22-alpine AS builder WORKDIR /app -COPY package.json package-lock.json ./ -RUN npm ci +COPY package.json package-lock.json* ./ +RUN npm install && npm audit fix COPY . . RUN npx vite build