···000001FROM golang:alpine AS build
2+3+FROM alpine AS runtime
4+RUN addgroup --system --gid 1001 tangled
5+RUN adduser --system --uid 1001 tangled
6+RUN mkdir -p /var/lib/tangled
7+VOLUME ["/var/lib/tangled"]
8+9+FROM build AS tangled
10+# earliest version with knot & spindle
11+ARG TANGLED_VERSION=v1.6.0-alpha
12+ENV URL=https://tangled.org/tangled.org/core/archive/${TANGLED_VERSION}
13+RUN wget -O '-' $URL | tar -zxvf '-'
14+RUN mv core-${TANGLED_VERSION} /core
15+WORKDIR /core
16RUN go mod download
17+18+FROM build AS build_spindle
19+WORKDIR /app
20+COPY --from=tangled /core .
21RUN go build -o spindle cmd/spindle/main.go
2223+FROM build AS build_knot
24+WORKDIR /app
25+COPY --from=tangled /core .
26+RUN go build -o knot cmd/knot/main.go
27+28+FROM runtime AS spindle
29+RUN mkdir -p /var/log/spindle
30+COPY --from=build_spindle /app/spindle /usr/bin/spindle
31+ENV SPINDLE_SERVER_DB_PATH=/var/lib/tangled/spindle.db
32+USER tangled
33EXPOSE 6555
34+VOLUME ["/var/log/spindle"]
35+CMD ["spindle"]
36+37+FROM runtime AS knot
38+COPY --from=build_knot /app/knot /usr/bin/knot
39+ENV KNOT_SERVER_DB_PATH=/var/lib/tangled/knotserver.db
40+ENV KNOT_REPO_SCAN_PATH=/home/git/repositories
41+ENV KNOT_SERVER_INTERNAL_LISTEN_ADDR=localhost:5444
42+USER tangled
43+EXPOSE 5555
44+VOLUME ["/var/log/spindle"]
45+CMD ["knot"]
+40-36
README.md
···1-# tubbo/spindle
23-A container image for the Spindle CI server.
0045## Usage
67-Set your configuration in a `.env` file:
89-```env
10-SPINDLE_SERVER_HOSTNAME="your.spindle.server.host"
11-SPINDLE_SERVER_OWNER="did:web:your.handle"
12```
1314-Create a `compose.yml` to configure the Spindle service, or add it to
15-an existing Compose file:
1617-```yaml
18-name: tangled
19-services:
20- spindle:
21- image: tubbo/spindle:latest
22- environment:
23- - SPINDLE_SERVER_HOSTNAME
24- - SPINDLE_SERVER_OWNER
25- volumes:
26- - certs:/app
27- - pipelines:/var/log/spindle
28- caddy:
29- image: caddy:alpine
30- command: >
31- caddy reverse-proxy --from ${SPINDLE_SERVER_HOSTNAME} --to spindle:6555
32- depends_on:
33- - spindle
34- ports:
35- - 443:443
36- - 443:443/udp
37- volumes:
38- - caddy:/data
39-volumes:
40- certs:
41- spindle:
42- pipelines:
43```
4445-Run the Spindle server and its Caddy frontend:
000000000004647```sh
48-docker compose up --detach
000000000000049```
0000
···1+# Tangled Containers
23+Container images for the [Tangled][] knot and spindle servers. All tagged
4+versions of `@tangled.org/core` are supported, as well as directly from the
5+`master` branch.
67## Usage
89+Start a Knot Server:
1011+```sh
12+docker run --name knot -e KNOT_SERVER_HOSTNAME=example.com -e KNOT_SERVER_OWNER=did:plc:yourdidgoeshere tubbo/knot
013```
1415+Start a Spindle Server:
01617+```sh
18+docker run --name spindle -e SPINDLE_SERVER_HOSTNAME=example.com -e SPINDLE_SERVER_OWNER=did:plc:yourdidgoeshere tubbo/spindle
00000000000000000000000019```
2021+### Supported tags
22+23+- `latest` for the most recently tagged version
24+- `v1.x.x-alpha` to specify the tag
25+- `edge` to use the most recent Git commit to `master`
26+27+## Development
28+29+Images are built with [Docker Bake][], using [mise][] as a task runner and
30+toolchain installer.
31+32+To contribute to this repository, clone it from Tangled:
3334```sh
35+git clone https://tangled.org/@psychedeli.ca/tangled-containers
36+cd tangled-containers
37+```
38+39+Install dependencies with [mise][]:
40+41+```sh
42+mise install
43+```
44+45+Then, build the most recent images by running:
46+47+```sh
48+mise build
49```
50+51+[Tangled]: https://tangled.org
52+[Docker Bake]: https://docs.docker.com/build/bake/
53+[mise]: https://mise.jdx.dev