commit 30504e239d35e89e5ec94d0c02b3b6bd70775575
parent c1f7ebf54d1be6e1ec07d89570ebf2d74f59fa1b
Author: Damian Myrda <damian@prime8.dev>
Date: Tue, 20 Oct 2026 22:30:53 +0000
build(docker): install git in runtime image for repo reads
Add git to the alpine stage and trust every directory via
safe.directory '*', since the bare repos are bind-mounted read-only
from a host user with a different uid.
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/Dockerfile b/Dockerfile
@@ -13,6 +13,14 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /server ./cmd/server
FROM alpine:latest
WORKDIR /app
+# git reads project READMEs from bare repos bind-mounted read-only from a
+# host user with a different uid, so trust every directory.
+RUN apk add --no-cache git \
+ && git config --system safe.directory '*'
+
+ENV GIT_REPOS_DIR=/srv/git/repos
+ENV GIT_WEB_BASE=https://git.prime8.dev
+
COPY --from=build /server ./server
COPY --from=build /app/static ./static
COPY --from=build /app/content ./content