Operations

Production Dockerfile


The orchestrator includes a multi-stage Dockerfile for containerized deployments.

Dockerfile

1
# Build stage
2
FROM rust:1.75-slim as builder
3
WORKDIR /app
4
RUN apt-get update && apt-get install -y \
5
pkg-config libssl-dev protobuf-compiler \
6
&& rm -rf /var/lib/apt/lists/*
7
COPY Cargo.toml Cargo.lock ./
8
COPY crates ./crates
9
COPY services/orchestrator ./services/orchestrator
10
WORKDIR /app/services/orchestrator
11
RUN cargo build --release
12
13
# Runtime stage
14
FROM debian:bookworm-slim
15
RUN apt-get update && apt-get install -y \
16
ca-certificates libssl3 curl \
17
&& rm -rf /var/lib/apt/lists/*
18
RUN useradd -m -u 1000 orchestrator
19
COPY --from=builder /app/target/release/orchestrator /usr/local/bin/orchestrator
20
USER orchestrator
21
EXPOSE 50051 8080
22
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
23
CMD curl -f http://localhost:8080/health/live || exit 1
24
ENV LOG_LEVEL=info LOG_FORMAT=json \
25
GRPC_BIND_ADDR=0.0.0.0:50051 HTTP_BIND_ADDR=0.0.0.0:8080
26
ENTRYPOINT ["orchestrator"]

Build and Run

1
# From the repository root
2
docker build -f services/orchestrator/Dockerfile -t orcher-orchestrator .
3
4
docker run -d \
5
--name orchestrator \
6
--network orcher-network \
7
-p 50051:50051 \
8
-p 8001:8001 \
9
-e DATABASE_URL="postgresql://orcher:orcher@orcher-pgbouncer:5432/orcher" \
10
-e REDIS_URL="redis://orcher-redis:6379" \
11
-e LOG_FORMAT=json \
12
orcher-orchestrator

Key Properties

  • Non-root user — Runs as orchestrator (uid 1000)
  • Health check — Checks http://localhost:8080/health/live every 30 seconds
  • Minimal runtime — debian:bookworm-slim with only ca-certificates, libssl3, and curl
  • JSON logging — Default format set to json for production log aggregation

Full Production Stack

Combine the backing services with containerized orchestrator:

1
# Start backing services
2
cd docker
3
docker compose up -d
4
5
# Build and run orchestrator on the same network
6
docker build -f services/orchestrator/Dockerfile -t orcher-orchestrator ..
7
docker run -d \
8
--name orchestrator \
9
--network orcher-network \
10
-p 50051:50051 \
11
-p 8001:8001 \
12
-e DATABASE_URL="postgresql://orcher:orcher@orcher-pgbouncer:5432/orcher" \
13
-e REDIS_URL="redis://orcher-redis:6379" \
14
-e LOG_FORMAT=json \
15
orcher-orchestrator

Database migrations run automatically on orchestrator startup — no separate migration step is needed.


Next Steps