Spaces:
Sleeping
Sleeping
| # ========================================== | |
| # SAAP Frontend Dockerfile (Multi-Stage Build) | |
| # Vue.js 3 + TypeScript + Vite + Nginx | |
| # ========================================== | |
| # ========================================== | |
| # Stage 1: Builder (Build Vue.js Application) | |
| # ========================================== | |
| FROM node:20-alpine AS builder | |
| LABEL maintainer="SATWARE AG <[email protected]>" | |
| LABEL description="SAAP Frontend - satware Autonomous Agent Platform" | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy package files for dependency installation | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm ci && \ | |
| npm cache clean --force | |
| # Copy application source | |
| COPY . . | |
| # Build application for production | |
| RUN npm run build | |
| # ========================================== | |
| # Stage 2: Runtime (Nginx with Built Assets) | |
| # ========================================== | |
| FROM nginx:1.25-alpine AS runtime | |
| # Install curl for health checks | |
| RUN apk add --no-cache curl | |
| # Copy custom nginx configuration | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| # Copy built assets from builder stage | |
| COPY --from=builder /app/dist /usr/share/nginx/html | |
| # Set permissions for static files | |
| RUN chmod -R 755 /usr/share/nginx/html | |
| # Expose port | |
| EXPOSE 80 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ | |
| CMD curl -f http://localhost/ || exit 1 | |
| # Start nginx | |
| CMD ["nginx", "-g", "daemon off;"] | |