Production state

This commit is contained in:
2026-07-13 01:26:49 +08:00
parent 7cb409f5a6
commit 8c6e6a54cc
21 changed files with 769 additions and 76 deletions
+5 -1
View File
@@ -1,13 +1,17 @@
FROM golang:1.26 AS build
WORKDIR /src
COPY go.mod go.sum* ./
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /preface-tools ./cmd/preface-tools
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /healthcheck ./cmd/healthcheck
FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /app
COPY --from=build /preface-tools /usr/local/bin/preface-tools
COPY --from=build /healthcheck /usr/local/bin/healthcheck
COPY --from=build /src/prompts /app/prompts
VOLUME ["/app/data"]
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD ["/usr/local/bin/healthcheck", "http://127.0.0.1:8080/readyz"]
ENTRYPOINT ["/usr/local/bin/preface-tools"]