···44> This is a community maintained repository, support is not guaranteed.
5566Docker container and compose setup to run a [Tangled](https://tangled.org) knot
77-and host your own repository data.
77+and spindle, hosting your own repository data and CI.
8899## Pre-built Images
10101111-There is a [repository](https://hub.docker.com/r/tngl/knot) of pre-built images
1111+There is a [repository](https://hub.docker.com/r/tngl) of pre-built images
1212for tags starting at `v1.8.0-alpha` if you prefer.
13131414```
1515docker pull tngl/knot:v1.10.0-alpha
1616+docker pull tngl/spindle:v1.10.0-alpha
1617```
17181819Note that these are *not* official images, you use them at your own risk.
19202020-## Building The Image
2121+## Building The Images
2222+2323+Both the knot and spindle images are built using the same `Dockerfile`, since
2424+they're sourced from the same codebase and can therefore share a lot of the
2525+build steps (such as `go mod download`), caching results between them. You
2626+can build the images locally by running `docker bake`:
2727+2828+```sh
2929+docker bake
3030+```
3131+3232+Optionally, choose a target image to build:
3333+3434+```sh
3535+docker bake knot
3636+docker bake spindle
3737+```
21382239By default the `Dockerfile` will build the latest tag, but you can change it
2340with the `TAG` build argument.
24412542```sh
2626-docker build -t knot:latest --build-arg TAG=master .
4343+docker bake --build-arg TAG=v1.10.0-alpha
2744```
28452929-The command above for example will build the latest commit on the `master`
3030-branch.
4646+The command above for example will build the `v1.10.0-alpha` tag.
31473232-By default it will also create a `git` user with user and group ID 1000:1000,
4848+By default it will also create a `git` / `spindle` user with user and group ID 1000:1000,
3349but you can change it with the `UID` and `GID` build arguments.
34503551```sh
3636-docker build -t knot:latest --build-arg UID=$(id -u) GID=$(id -g)
5252+docker bake --build-arg UID=$(id -u) --build-arg GID=$(id -g)
3753```
38543955The command above for example will create a user with the host user's UID and GID.
4056This is useful if you are bind mounting the repositories and app folder on the host,
4157as in the provided `docker-compose.yml` file.
5858+5959+You can also build the latest commit on `master` for both services by using
6060+the `-edge` targets. These will build to a tag named `:edge` to distinguish
6161+it from the `:latest` release:
6262+6363+```sh
6464+docker bake edge
6565+# or, with a specific target image
6666+docker bake edge-knot
6767+docker bake edge-spindle
6868+```
42694370<hr style="margin-bottom: 20px; margin-top: 10px" />
4471···59866087## Setting Up The Image
61886262-The simplest way to set up your own knot is to use the provided compose file
6363-and run the following:
8989+The simplest way to set up your own knot and spindle is to use the provided
9090+compose file and run the following:
64916592```sh
6666-export KNOT_SERVER_HOSTNAME=example.com
6767-export KNOT_SERVER_OWNER=did:plc:yourdidgoeshere
6868-export KNOT_SERVER_PORT=443
6969-docker compose up -d
9393+export KNOT_SERVER_HOSTNAME="knot.example.com"
9494+export SPINDLE_SERVER_HOSTNAME="spindle.example.com"
9595+export KNOT_SERVER_OWNER="did:plc:yourdidgoeshere"
9696+export KNOT_SERVER_PORT="443"
9797+9898+docker compose up --detach
7099```
7110072101This will setup everything for you including a reverse proxy.