hatchery-server 0.2.10

Host for hatchery subservices (harness, m4a, memory): one supervisor process, loopback control and health
Documentation
# hatchery-server (+ harness and memory4agent binaries) as a container.
# Build context: a directory holding the hatchery checkout as `hatchery/`;
# dependencies resolve from crates.io. `deploy/docker-build.sh` stages it.
# No token, key or master secret is baked in. Mount a persistent volume at
# /var/lib/hatchery (subservice data) and pass secrets through the environment
# or a secret file.
FROM rust:alpine AS build
RUN apk add --no-cache musl-dev pkgconf openssl-dev openssl-libs-static sqlite-dev sqlite-static perl make cmake clang git linux-headers
ENV OPENSSL_STATIC=1 PKG_CONFIG_ALL_STATIC=1
WORKDIR /src
COPY hatchery /src/hatchery
WORKDIR /src/hatchery
RUN cargo build --release -p hatchery-harness-service -p hatchery-server -p hatchery-harness-mcp
# memory4agent 0.3 from crates.io (tree-sitter and bundled sqlite compile here, not in the workspace).
RUN cargo install memory4agent --version "^0.3" --locked --root /opt/mem

FROM alpine:3
RUN apk add --no-cache ca-certificates
COPY --from=build /src/hatchery/target/release/hatchery-server /usr/local/bin/hatchery-server
COPY --from=build /src/hatchery/target/release/hatchery-harness /usr/local/bin/hatchery-harness
COPY --from=build /opt/mem/bin/memory4agent-server /usr/local/bin/memory4agent-server
VOLUME ["/var/lib/hatchery"]
ENV HATCHERY_SERVER_DATA_DIR=/var/lib/hatchery
ENTRYPOINT ["hatchery-server"]