Some checks failed
CI/CD Pipeline - Apartment Dashboard / Scan Dependencies (push) Successful in 44s
CI/CD Pipeline - Apartment Dashboard / Run Linter (push) Successful in 10m6s
CI/CD Pipeline - Apartment Dashboard / Build & Push Image (push) Failing after 2m36s
CI/CD Pipeline - Apartment Dashboard / Deploy to Production (push) Has been skipped
- Add apk upgrade to nginx:alpine to fix libpng vulnerabilities - Add scan-deps job that runs in parallel with lint
32 lines
577 B
Docker
32 lines
577 B
Docker
# Build stage
|
|
FROM node:20-alpine as build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies (including devDependencies needed for build)
|
|
RUN npm ci
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the app
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM nginx:alpine
|
|
|
|
# Update Alpine packages to fix security vulnerabilities
|
|
RUN apk upgrade --no-cache
|
|
|
|
# Copy built app to nginx
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
# Copy custom nginx config (optional)
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |