railyard/apps/toolgate/Dockerfile
caelum0x 8d7916dd14 docs(toolgate): Switchyard README, container image and Railyard README section
Multi-arch distroless Dockerfile (build context apps/toolgate), app README
with layout, configuration, bootstrap, usage and the MVP's deviations from
the spec, and a Switchyard row and section in the Railyard README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 02:36:57 +03:00

32 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1.7
#
# apps/toolgate: Switchyard server + CLI. Standalone workspace with no path
# dependencies outside apps/toolgate, so the build context is this directory:
#
# docker buildx build --platform linux/arm64,linux/amd64 -t railyard/switchyard apps/toolgate
#
# Runtime is distroless (CA bundle only); reqwest and sqlx use rustls, so
# there is no OpenSSL. Serves on :8130.
FROM rust:1.94-bookworm AS builder
WORKDIR /src
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY migrations ./migrations
COPY catalog ./catalog
RUN cargo build --release -p switchyard-server -p switchyard-cli \
&& strip target/release/switchyard-server target/release/sy
FROM gcr.io/distroless/cc-debian12:nonroot
WORKDIR /app
COPY --from=builder /src/target/release/switchyard-server /app/switchyard-server
COPY --from=builder /src/target/release/sy /app/sy
COPY --from=builder /src/catalog /app/catalog
ENV SWITCHYARD_CATALOG_DIR=/app/catalog \
SWITCHYARD_BIND=0.0.0.0:8130 \
SWITCHYARD_CACHE_MB=32
EXPOSE 8130
USER nonroot
ENTRYPOINT ["/app/switchyard-server"]
CMD ["serve"]