mirror of
https://github.com/luxfi/zapdb.git
synced 2026-07-27 06:54:45 +00:00
ZapDB has native streaming Backup(w, since) + Load(r). The standalone luxfi/zapdb-replicate repo was duplicate scaffolding. Sidecar daemon + restore init-container now live here under cmd/replicate/. Pre-fold lineage: standalone repo at luxfi/zapdb-replicate; final commit there c13a738 (deps Go 1.26.4 bump). No history was merged; small repo, clean copy.
27 lines
869 B
Docker
27 lines
869 B
Docker
# Build context must be the repo root (luxfi/zapdb).
|
|
# docker build -t zapdb-replicate -f deploy/replicate/Dockerfile .
|
|
FROM golang:1.26.4-bookworm AS build
|
|
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
go mod download
|
|
|
|
COPY . .
|
|
ARG VERSION=dev
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
|
go build \
|
|
-trimpath \
|
|
-ldflags "-s -w -X main.version=${VERSION}" \
|
|
-o /out/zapdb-replicate \
|
|
./cmd/replicate
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/zapdb-replicate /usr/local/bin/zapdb-replicate
|
|
USER nonroot:nonroot
|
|
ENTRYPOINT ["/usr/local/bin/zapdb-replicate"]
|
|
CMD ["replicate", "--config", "/etc/zapdb-replicate/config.yaml"]
|