# Multi-stage build for VAPORA Agents # Build stage FROM rust:1.75-alpine AS builder WORKDIR /usr/src/app # Install build dependencies RUN apk add --no-cache \ musl-dev \ pkgconfig \ openssl-dev \ openssl-libs-static # Copy workspace files COPY Cargo.toml Cargo.lock ./ COPY crates ./crates # Build agents RUN cargo build --release -p vapora-agents # Runtime stage FROM alpine:latest RUN apk add --no-cache \ ca-certificates \ openssl \ curl WORKDIR /app # Copy binary from builder COPY --from=builder /usr/src/app/target/release/vapora-agents /app/vapora-agents # Create non-root user RUN addgroup -g 1000 vapora && \ adduser -D -u 1000 -G vapora vapora && \ chown -R vapora:vapora /app USER vapora # Expose port EXPOSE 9000 # Health check HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \ CMD curl -f http://localhost:9000/health || exit 1 # Run ENTRYPOINT ["/app/vapora-agents"]