Community maintained Docker config for the knot server
at spindle 70 lines 2.2 kB view raw
1from golang:1.25-alpine as builder 2env CGO_ENABLED=1 3 4arg TAG='v1.11.0-alpha' 5 6workdir /app 7run apk add git gcc musl-dev 8run git clone -b ${TAG} https://tangled.org/@tangled.org/core . 9 10FROM builder AS build-knot 11RUN go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot 12 13FROM builder AS build-spindle 14RUN go build -o /usr/bin/spindle ./cmd/spindle 15 16from alpine:latest AS knot 17ENV KNOT_REPO_SCAN_PATH=/home/git/repositories 18expose 5555 19expose 22 20 21label org.opencontainers.image.title='knot' 22label org.opencontainers.image.description='data server for tangled' 23label org.opencontainers.image.source='https://tangled.org/@tangled.org/knot-docker' 24label org.opencontainers.image.url='https://tangled.org' 25label org.opencontainers.image.vendor='tangled.org' 26label org.opencontainers.image.licenses='MIT' 27 28arg UID=1000 29arg GID=1000 30 31copy rootfs . 32run chmod 755 /etc 33run chmod -R 755 /etc/s6-overlay 34run apk add shadow s6-overlay execline openssl openssh git curl bash 35run groupadd -g $GID -f git 36run useradd -u $UID -g $GID -d /home/git git 37run openssl rand -hex 16 | passwd --stdin git 38run mkdir -p /home/git/repositories && chown -R git:git /home/git 39copy --from=build-knot /usr/bin/knot /usr/bin 40run mkdir /app && chown -R git:git /app 41 42healthcheck --interval=60s --timeout=30s --start-period=5s --retries=3 \ 43 cmd curl -f http://localhost:5555 || exit 1 44entrypoint ["/init"] 45 46FROM alpine:edge AS spindle 47EXPOSE 6555 48 49LABEL org.opencontainers.image.title="spindle" 50LABEL org.opencontainers.image.description="ci server for tangled" 51LABEL org.opencontainers.image.source="https://tangled.org/@tangled.org/knot-docker" 52LABEL org.opencontainers.image.url="https://tangled.org" 53LABEL org.opencontainers.image.vendor="tangled.org" 54LABEL org.opencontainers.image.licenses="MIT" 55 56ARG UID=1000 57ARG GID=1000 58 59run apk add curl bash 60RUN adduser --system --uid $UID spindle 61RUN addgroup --system --gid $UID spindle 62RUN mkdir -p /app && chown -R spindle:spindle /app 63 64COPY --from=build-spindle /usr/bin/spindle /usr/bin 65 66WORKDIR /app 67CMD ["spindle"] 68VOLUME ["/app"] 69HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \ 70 CMD curl -f http://localhost:6555 || exit 1