Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / infra / agents / Dockerfile.agentd
Dockerfile.agentd27 lines · 1.1 KiBRaw
| 1 | # agentd: trusted orchestrator (web UI, task queue, OpenRouter loop, git push). |
| 2 | # Build context is infra/agents (Cargo workspace: proto, agentd, runner). |
| 3 | |
| 4 | FROM rust:1-bookworm AS build |
| 5 | WORKDIR /src |
| 6 | COPY Cargo.toml Cargo.lock ./ |
| 7 | COPY proto ./proto |
| 8 | COPY agentd ./agentd |
| 9 | # cargo resolves every workspace member even with -p; stub the runner. |
| 10 | COPY runner/Cargo.toml ./runner/Cargo.toml |
| 11 | RUN mkdir -p runner/src && echo 'fn main() {}' > runner/src/main.rs \ |
| 12 | && echo '' > runner/src/lib.rs |
| 13 | RUN cargo build -p agentd --release --locked |
| 14 | |
| 15 | FROM debian:bookworm-slim |
| 16 | RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \ |
| 17 | && rm -rf /var/lib/apt/lists/* \ |
| 18 | && groupadd -g 10002 agentd \ |
| 19 | && useradd -u 10002 -g 10002 -d /state -M -s /usr/sbin/nologin agentd \ |
| 20 | && mkdir -p /state /mirror /signal \ |
| 21 | && chown 10002:10002 /state /mirror |
| 22 | COPY --from=build /src/target/release/agentd /usr/local/bin/agentd |
| 23 | USER 10002:10002 |
| 24 | # Mirror is shared read-only with the builder (another uid): keep it world-readable. |
| 25 | ENV HOME=/state |
| 26 | EXPOSE 8080 |
| 27 | ENTRYPOINT ["/usr/local/bin/agentd"] |