Files
Aegis/frontend/Dockerfile
T
kitos 070b402358
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
fix(deps): pin urllib3>=2.7.0 and idna>=3.15; apk upgrade in nginx stage; form-data override
2026-06-25 13:26:06 +02:00

49 lines
1.4 KiB
Docker

# ── Development Stage ──────────────────────────────────────────────────────
FROM node:20-alpine AS development
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies — use ci for reproducible installs (exact lock file versions)
RUN npm ci
# Copy source code
COPY . .
# Expose Vite dev server port
EXPOSE 5173
# Start dev server with host binding for Docker
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# ── Build Stage ────────────────────────────────────────────────────────────
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ── Production Stage ───────────────────────────────────────────────────────
FROM nginx:1.31.1-alpine3.23-slim AS production
# Patch Alpine system packages (resolves openssl CVEs in base image)
RUN apk update && apk upgrade --no-cache
# Copy built files to nginx
COPY --from=build /app/dist /usr/share/nginx/html
# Copy nginx config for SPA routing
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]