mirror of
https://github.com/dadosfera/maestro.git
synced 2026-12-05 05:50:06 +00:00
FIX: resolve HIGH security vulnerabilities (18 → 0)
Upgraded Node.js and dependencies to address critical vulnerabilities: **Infrastructure:** - Upgrade Node.js from 18.17-alpine to 20-alpine (Alpine 3.18 → 3.23) - Upgrade npm to 11.7.0 (includes glob 13.0.0 fix) - Replace npm ci with npm install, then back to npm ci with npm 11 lock **Dependencies:** - Update axios: 0.27.2 → 0.30.2 (fixes 2 CVEs) - Update body-parser: 1.20.1/1.20.2 → 1.20.3 - Update cross-spawn: 7.0.3 → 7.0.6 (hoisted) - Update glob: 10.2.4 → 10.5.0 (hoisted) - Update path-to-regexp: 3.2.0 → 3.3.0 (maintains @nestjs/swagger compatibility) - Update semver: 7.5.1 → 7.5.2 **Results:** - HIGH vulnerabilities: 18 → 0 (100% reduction) - Alpine OS vulnerabilities: 6 → 0 (fixed by Alpine 3.23) - Node.js vulnerabilities: 12 → 0 - All tests passing - Production verified working 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
FROM node:20-alpine AS base_image
|
||||
RUN npm install -g npm@latest
|
||||
|
||||
FROM base_image AS build_base
|
||||
WORKDIR /app
|
||||
RUN apk update
|
||||
RUN apk add --no-cache \
|
||||
aws-cli \
|
||||
chromium \
|
||||
nss \
|
||||
freetype \
|
||||
harfbuzz \
|
||||
ca-certificates \
|
||||
ttf-freefont
|
||||
COPY package*.json ./
|
||||
|
||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||
|
||||
|
||||
# Local build with secrets
|
||||
FROM build_base AS build
|
||||
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
||||
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
|
||||
FROM base_image
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/package*.json ./
|
||||
RUN apk update
|
||||
RUN apk add --no-cache \
|
||||
chromium \
|
||||
nss \
|
||||
freetype \
|
||||
harfbuzz \
|
||||
ca-certificates \
|
||||
ttf-freefont
|
||||
|
||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||
|
||||
ENTRYPOINT ["npm", "run", "start:prod"]
|
||||
Reference in New Issue
Block a user