2026-01-08 21:32:59 +00:00
|
|
|
# Multi-stage build for Orchestrator
|
|
|
|
|
# Builds from platform workspace root
|
2025-10-07 10:59:52 +01:00
|
|
|
|
2026-01-08 21:32:59 +00:00
|
|
|
# Build stage - Using nightly for consistency with control-center
|
|
|
|
|
FROM rustlang/rust:nightly-bookworm AS builder
|
|
|
|
|
|
|
|
|
|
WORKDIR /workspace
|
2025-10-07 10:59:52 +01:00
|
|
|
|
|
|
|
|
# Install build dependencies
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
pkg-config \
|
|
|
|
|
libssl-dev \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2026-01-08 21:32:59 +00:00
|
|
|
# Copy entire platform workspace (required for workspace dependencies)
|
2025-10-07 10:59:52 +01:00
|
|
|
COPY Cargo.toml Cargo.lock ./
|
2026-01-08 21:32:59 +00:00
|
|
|
COPY orchestrator ./orchestrator
|
|
|
|
|
COPY control-center ./control-center
|
|
|
|
|
COPY control-center-ui ./control-center-ui
|
|
|
|
|
COPY mcp-server ./mcp-server
|
|
|
|
|
COPY installer ./installer
|
2025-10-07 10:59:52 +01:00
|
|
|
|
2026-01-08 21:32:59 +00:00
|
|
|
# Build orchestrator (workspace-aware)
|
|
|
|
|
WORKDIR /workspace
|
|
|
|
|
RUN cargo build --release --package provisioning-orchestrator
|
2025-10-07 10:59:52 +01:00
|
|
|
|
|
|
|
|
# Runtime stage
|
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
|
|
|
|
|
|
# Install runtime dependencies
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
curl \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Create non-root user
|
|
|
|
|
RUN useradd -m -u 1000 provisioning && \
|
|
|
|
|
mkdir -p /data /var/log/orchestrator && \
|
|
|
|
|
chown -R provisioning:provisioning /data /var/log/orchestrator
|
|
|
|
|
|
|
|
|
|
# Copy binary from builder
|
2026-01-08 21:32:59 +00:00
|
|
|
COPY --from=builder /workspace/target/release/provisioning-orchestrator /usr/local/bin/provisioning-orchestrator
|
|
|
|
|
RUN chmod +x /usr/local/bin/provisioning-orchestrator
|
2025-10-07 10:59:52 +01:00
|
|
|
|
|
|
|
|
# Copy default configuration
|
2026-01-08 21:32:59 +00:00
|
|
|
COPY orchestrator/config.defaults.toml /etc/provisioning/config.defaults.toml
|
2025-10-07 10:59:52 +01:00
|
|
|
|
|
|
|
|
# Switch to non-root user
|
|
|
|
|
USER provisioning
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Expose port
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
|
|
# Set environment variables
|
|
|
|
|
ENV RUST_LOG=info
|
|
|
|
|
ENV DATA_DIR=/data
|
|
|
|
|
|
|
|
|
|
# Health check
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
|
|
|
|
CMD curl -f http://localhost:8080/health || exit 1
|
|
|
|
|
|
|
|
|
|
# Run the binary
|
|
|
|
|
CMD ["provisioning-orchestrator"]
|