Recently Written · git

sbm-sync

Sync server for sbm bookmark files: one small Go program, plain files, AGPL

git clone https://github.com/equwal/sbm-sync

Log | Files | Refs


Dockerfile (627 bytes)

1 # Image of sbm-sync: the static binary on distroless, as user nonroot.
2 # compose.yaml builds it and puts Caddy in front for TLS.
3 FROM golang:1.26-alpine AS build
4 WORKDIR /src
5 COPY go.mod go.sum ./
6 RUN go mod download
7 COPY *.go pages.html ./
8 RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /sbm-sync . && mkdir /data
9 
10 FROM gcr.io/distroless/static-debian13:nonroot
11 COPY --from=build /sbm-sync /usr/local/bin/sbm-sync
12 # A new volume on /data gets the owner of this directory: nonroot.
13 COPY --from=build --chown=65532:65532 /data /data
14 ENV SBM_ADDR=:8750 SBM_DATA=/data
15 EXPOSE 8750
16 ENTRYPOINT ["/usr/local/bin/sbm-sync"]