FROM rust:1-bookworm AS build
WORKDIR /src
COPY . .
RUN apt-get update && apt-get install -y protobuf-compiler && rm -rf /var/lib/apt/lists/*
RUN cargo build --release --bin {{service_name}} --bin {{service_name}}-mcp

FROM gcr.io/distroless/cc-debian12
COPY --from=build /src/target/release/{{service_name}}     /usr/local/bin/{{service_name}}
COPY --from=build /src/target/release/{{service_name}}-mcp /usr/local/bin/{{service_name}}-mcp
EXPOSE 50051 50052
