pr_01m47d24b0e6n91zwymwxg0vpx/deploy/self-host/gitstore/Dockerfile

17 lines693 bytesCodeBlame
1# g1t's git store for self-hosting: bare repositories on a volume, served
2# by git itself. See server.mjs.
3FROM node:24-bookworm-slim
4RUN apt-get update \
5 && apt-get install -y --no-install-recommends git ca-certificates \
6 && rm -rf /var/lib/apt/lists/*
7WORKDIR /app
8COPY server.mjs ./
9ENV GITSTORE_ROOT=/data/git GITSTORE_PORT=8080
10# Owned by the user it runs as, so new volumes are writable.
11RUN mkdir -p /data/git /secrets && chown node:node /data/git /secrets
12VOLUME /data/git
13EXPOSE 8080
14USER node
15HEALTHCHECK --interval=5s --timeout=3s --retries=20 \
16 CMD node -e "fetch('http://127.0.0.1:8080/healthz').then(r=>process.exit(r.ok?0:1),()=>process.exit(1))"
17CMD ["node", "server.mjs"]