# Nomos agent container — standalone MCP client gateway (Phase 4)
FROM golang:1.26-alpine AS builder

RUN apk add --no-cache git ca-certificates

WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN CGO_ENABLED=0 go build -o /nomos -tags timetzdata -ldflags="-s -w" ./cmd/nomos

FROM gcr.io/distroless/static:nonroot

COPY --from=builder /nomos /nomos
COPY nomos/ /app/nomos/

ENV NOMOS_MCP_URL=http://api:8090/mcp
ENV NOMOS_AGENT_SLUG=agent:nomos
ENV NOMOS_LISTEN=:8092
ENV NOMOS_MODEL=deepseek/deepseek-v4-pro

EXPOSE 8092

ENTRYPOINT ["/nomos", "serve"]
