Dockerfile (848B)
1 FROM golang:1.27 AS build 2 WORKDIR /app 3 4 COPY go.mod go.sum ./ 5 RUN go mod download 6 7 COPY . . 8 9 RUN go run ./cmd/buildjs 10 11 RUN CGO_ENABLED=0 GOOS=linux go build -o /server ./cmd/server 12 13 FROM alpine:latest 14 WORKDIR /app 15 16 # git reads project READMEs from bare repos bind-mounted read-only from a 17 # host user with a different uid, so trust every directory. 18 RUN apk add --no-cache git \ 19 && git config --system safe.directory '*' 20 21 ENV GIT_REPOS_DIR=/srv/git/repos 22 ENV GIT_CLONE_BASE=https://prime8.dev 23 ENV GIT_HOOKS_DIR=/app/git-hooks 24 ENV GIT_DEPLOY_DIR=/srv/git/deploy 25 ENV GIT_OWNER_KEYS=/app/.ssh/owner_keys 26 27 COPY --from=build /server ./server 28 COPY --from=build /app/static ./static 29 COPY --from=build /app/git-hooks ./git-hooks 30 31 ENV SSH_PORT=22 32 ENV TERM=xterm-256color 33 ENV COLORTERM=truecolor 34 EXPOSE 22 35 36 ENV WEB_PORT=3000 37 EXPOSE 3000 38 39 CMD ["./server"]