File size: 1,413 Bytes
4343907
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ==========================================
# 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;"]