# ThreatHunt Frontend - Node.js React FROM node:18-alpine AS builder WORKDIR /app # Copy package files COPY frontend/package.json frontend/package-lock.json* ./ # Install dependencies RUN npm ci # Copy source COPY frontend/public ./public COPY frontend/src ./src COPY frontend/tsconfig.json ./ # Build application RUN npm run build # Production stage FROM node:18-alpine WORKDIR /app # Install serve to serve the static files RUN npm install -g serve # Copy built application from builder COPY --from=builder /app/build ./build # Create non-root user RUN addgroup -g 1000 appuser && adduser -D -u 1000 -G appuser appuser USER appuser # Expose port EXPOSE 3000 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1 # Serve application CMD ["serve", "-s", "build", "-l", "3000"]