forked from
tangled.org/knot-docker
Community maintained Docker config for the spindle server
1FROM golang:1.24-alpine AS builder
2ENV CGO_ENABLED=1
3
4ARG TAG='v1.10.0-alpha'
5
6WORKDIR /app
7RUN apk add git gcc musl-dev
8RUN git clone -b ${TAG} https://tangled.org/@tangled.org/core .
9RUN go build -o /usr/bin/spindle -ldflags '-s -w -extldflags "-static"' ./cmd/spindle
10
11FROM alpine:edge
12EXPOSE 5555
13EXPOSE 22
14
15LABEL org.opencontainers.image.title='spindle'
16LABEL org.opencontainers.image.description='CI runner for tangled'
17LABEL org.opencontainers.image.source='https://tangled.org/@keea.dog/spindle-docker'
18LABEL org.opencontainers.image.url='https://tangled.org'
19LABEL org.opencontainers.image.vendor='tangled.org'
20LABEL org.opencontainers.image.licenses='MIT'
21
22ARG UID=1000
23ARG GID=1000
24
25COPY rootfs .
26RUN chmod 755 /etc
27RUN chmod -R 755 /etc/s6-overlay
28RUN apk add shadow s6-overlay execline openssl curl
29RUN groupadd -g $GID -f spindle
30RUN useradd -u $UID -g $GID -d /home/spindle spindle
31RUN openssl rand -hex 16 | passwd --stdin spindle
32RUN mkdir -p /home/spindle/repositories && chown -R spindle:spindle /home/spindle
33COPY --from=builder /usr/bin/spindle /usr/bin
34RUN mkdir /app && chown -R spindle:spindle /app
35
36HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \
37 cmd curl -f http://localhost:5555 || exit 1
38
39ENTRYPOINT ["/init"]