- Added api-security-hardening (helmet, rate limits) - Added nodejs-backend-patterns (error handling) - Added observability-monitoring (pino logging) - Added websocket-engineer (socket.io real-time updates) - Added docker (Multi-stage build, compose) - Added vitest (testing configuration and store tests) - Added data-visualizer (MetricsBar and HostChart) - Added infrastructure-monitoring/proxmox-admin/network-engineer types - Fixed UI accessibility and styling - Cleaned up node_modules tracking
38 lines
724 B
Docker
38 lines
724 B
Docker
# Build stage
|
|
FROM node:18-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM node:18-alpine
|
|
WORKDIR /app
|
|
|
|
# Non-root user for security
|
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci --only=production
|
|
|
|
# Copy built frontend
|
|
COPY --from=builder /app/dist ./dist
|
|
|
|
# Copy server files
|
|
COPY server/ ./server/
|
|
COPY tsconfig*.json ./
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3001
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3001/api/health || exit 1
|
|
|
|
USER appuser
|
|
|
|
EXPOSE 3000 3001
|
|
|
|
CMD ["npx", "tsx", "server/index.ts"]
|