Fix security vulnerabilities and add early dependency scanning
Some checks failed
CI/CD Pipeline - Apartment API / Scan Dependencies (push) Successful in 18s
CI/CD Pipeline - Apartment API / Run Tests (push) Successful in 10m20s
CI/CD Pipeline - Apartment API / Build & Push Image (push) Failing after 3m8s
CI/CD Pipeline - Apartment API / Deploy to Production (push) Has been skipped

- Update to node:20-alpine base image
- Add apk upgrade to fix OS-level vulnerabilities
- Update npm to latest to fix bundled package vulnerabilities
- Add scan-deps job that runs in parallel with tests
- Replace deprecated --only=production with --omit=dev
This commit is contained in:
2026-01-23 16:10:45 -07:00
parent 3518a8344a
commit 8dfdfdc8bb
2 changed files with 31 additions and 3 deletions

View File

@ -1,8 +1,12 @@
FROM node:18-alpine
FROM node:20-alpine
# Set working directory
WORKDIR /app
# Update Alpine packages and npm to fix security vulnerabilities
RUN apk upgrade --no-cache && \
npm install -g npm@latest
# Install Curl
RUN apk add --no-cache curl
@ -10,7 +14,7 @@ RUN apk add --no-cache curl
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
RUN npm ci --omit=dev
# Copy source code
COPY . .