1# Knot Docker
2
3> **IMPORTANT**
4> This is a community maintained repository, support is not guaranteed.
5
6Docker container and compose setup to run a [Tangled](https://tangled.sh) knot
7and host your own repository data.
8
9## Pre-built Images
10
11There is a [repository](https://hub.docker.com/r/hqnna/knot) of pre-built images
12for tags starting at `v1.4.0-alpha` if you prefer.
13
14```
15docker pull hqnna/knot:v1.4.0-alpha
16```
17
18Note that these are *not* official images, you use them at your own risk.
19
20## Building The Image
21
22By default the `Dockerfile` will build the latest tag, but you can change it
23with the `TAG` build argument.
24
25```sh
26docker build -t knot:latest --build-arg TAG=master .
27```
28
29The command above for example will build the latest commit on the `master`
30branch.
31
32By default it will also create a `git` user with user and group ID 1000:1000,
33but you can change it with the `UID` and `GID` build arguments.
34
35```sh
36docker build -t knot:latest --build-arg UID=$(id -u) GID=$(id -g)
37```
38
39The command above for example will create a user with the host user's UID and GID.
40This is useful if you are bind mounting the repositories and app folder on the host,
41as in the provided `docker-compose.yml` file.
42
43<hr style="margin-bottom: 20px; margin-top: 10px" />
44
45When using compose, it can be specified as a build argument which will be
46passed to the builder.
47
48```yaml
49build:
50 context: .
51 args: { TAG: master }
52```
53
54This will for example tell docker to build it using the `master` branch like
55the command.
56
57## Setting Up The Image
58
59The simplest way to set up your own knot is to use the provided compose file
60and run the following:
61
62```sh
63export KNOT_SERVER_HOSTNAME=example.com
64export KNOT_SERVER_OWNER=did:plc:yourdidgoeshere
65export KNOT_SERVER_PORT=443
66docker compose up -d
67```
68
69This will setup everything for you including a reverse proxy.