initial commit

This commit is contained in:
iceBear67
2026-07-15 14:28:58 +08:00
commit 6e0d7ec33f
47 changed files with 4022 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# redapricot Go client image.
#
# Build from the repository root (the Go module lives here):
# docker build -t redapricot-client .
#
# Run with a mounted config:
# docker run --rm -v "$PWD/client.json:/etc/redapricot/client.json" \
# redapricot-client /etc/redapricot/client.json
#
# syntax=docker/dockerfile:1
# ---- build stage ----
FROM golang:1.25 AS build
WORKDIR /src
# Cache module downloads separately from the source.
COPY go.mod go.sum ./
RUN go mod download
# Build a static, stripped binary.
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" \
-o /out/redapricot-client ./cmd/redapricot-client
# ---- runtime stage ----
FROM gcr.io/distroless/static:nonroot
COPY --from=build /out/redapricot-client /usr/local/bin/redapricot-client
USER nonroot:nonroot
ENTRYPOINT ["/usr/local/bin/redapricot-client"]
# Default config path; override by passing a different path as the container arg.
CMD ["/etc/redapricot/client.json"]