···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-```
1414+```sh
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:
21332222-By default the `Dockerfile` will build the latest tag, but you can change it
2323-with the `TAG` build argument.
3434+```sh
3535+docker bake knot
3636+docker bake spindle
3737+```
3838+3939+By default this will build the latest tag, but you can target a specific tag
4040+like so:
24412542```sh
2626-docker build -t knot:latest --build-arg TAG=master .
4343+docker bake knot-v1-10-0-alpha spindle-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 for both the
4747+`knot` and `spindle`. They're expressed as individual bake targets, so you can
4848+also optionally specify just one to build at a specific version.
4949+5050+You can also build all tagged releases:
5151+5252+```sh
5353+docker bake all
5454+```
31553232-By default it will also create a `git` user with user and group ID 1000:1000,
5656+By default it will also create a `git` / `spindle` user with user and group ID 1000:1000,
3357but you can change it with the `UID` and `GID` build arguments.
34583559```sh
3636-docker build -t knot:latest --build-arg UID=$(id -u) GID=$(id -g)
6060+docker bake UID=$(id -u) GID=$(id -g)
3761```
38623963The command above for example will create a user with the host user's UID and GID.
4064This is useful if you are bind mounting the repositories and app folder on the host,
4165as in the provided `docker-compose.yml` file.
42666767+You can also build the latest commit on `master` for both services by using
6868+the `-edge` targets. These will build to a tag named `:edge` to distinguish
6969+it from the `:latest` release:
7070+7171+```sh
7272+docker bake edge
7373+#
7474+# or, with a specific target image...
7575+#
7676+docker bake edge-knot
7777+docker bake edge-spindle
7878+```
7979+4380<hr style="margin-bottom: 20px; margin-top: 10px" />
44814582When using compose, these can be specified as build arguments which will be
···59966097## Setting Up The Image
61986262-The simplest way to set up your own knot is to use the provided compose file
6363-and run the following:
9999+The simplest way to set up your own knot and spindle is to use the provided
100100+compose file and run the following:
6410165102```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
103103+export KNOT_SERVER_HOSTNAME="knot.example.com"
104104+export SPINDLE_SERVER_HOSTNAME="spindle.example.com"
105105+export KNOT_SERVER_OWNER="did:plc:yourdidgoeshere"
106106+export KNOT_SERVER_PORT="443"
107107+108108+docker compose up --detach
70109```
7111072111This will setup everything for you including a reverse proxy.