orchard
mirrorEvery site I host, in one repo, along with the Cloudflare Tunnel and Caddy that front them. It's all Go, Vite, and SQLite, and it runs on a desktop at home with nothing listening on an inbound port.
blogbuncaddycloudflare-tunneldockergogolanghomelabhtml-templatemonorepoself-hostedseosqlitestatic-sitetypstuptime-monitoringviteweb-analytics
1# llm.bythewood.me. Two stages and nothing in the last one but the binary, its
2# certificates and the timezone database.
3FROM golang:1.27-trixie AS build
4WORKDIR /src
5COPY go.mod go.sum ./
6RUN go mod download
7COPY . .
8# -tags embed swaps the disk asset loader for the embedded one, so the shipped
9# image cannot read templates off a filesystem that is not there.
10RUN CGO_ENABLED=0 go build -tags embed -trimpath -ldflags="-s -w" -o /app .
11
12FROM scratch
13COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
14COPY --from=build /usr/local/go/lib/time/zoneinfo.zip /usr/local/go/lib/time/
15COPY --from=build /app /app
16ENV ZONEINFO=/usr/local/go/lib/time/zoneinfo.zip
17EXPOSE 8000
18VOLUME ["/data"]
19HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
20 CMD ["/app", "-healthcheck"]
21ENTRYPOINT ["/app"]