···33> **IMPORTANT**
44> This is a community maintained repository, support is not guaranteed.
5566-Docker container and compose setup to run a [Tangled](https://tangled.sh) knot and host your own data.
66+Docker container and compose setup to run a [Tangled](https://tangled.sh) knot
77+and host your own repository data.
7888-## Simple Setup
99+## Building The Image
9101010-If you want an easy way to spin up a knot, you can simply run the following
1111-with docker installed:
1111+By default the `Dockerfile` will build the latest tag, but you can change it
1212+with the `TAG` build argument.
12131313-```console
1414-$ docker compose up -d
1414+```sh
1515+docker build -t knot:latest --build-arg TAG=master .
1516```
16171717-This will setup the knot server, as well as caddy to expose the front-end.
1818+The command above for example will build the latest commit on the `master`
1919+branch.
18201919-## Bring Your Own Setup
2121+---
20222121-If you have your own compose setup already, you will just need point your web
2222-server to the knot's HTTP port (namely `5555`), you can do this with docker by
2323-setting another container to `depends_on` it and then pointing it to the name
2424-of the container with the port. For example, with a very basic caddy webserver
2525-container:
2323+This can be done in a compose file as well by specifying it as an build
2424+argument.
26252626+```yaml
2727+build:
2828+ context: .
2929+ args: { TAG: master }
2730```
2828-caddy reverse-proxy --from ${KNOT_SERVER_HOSTNAME} --to knot:5555
3131+3232+Will tell docker to pass the `TAG` argument to the `Dockerfile` when building.
3333+3434+## Setting Up The Image
3535+3636+The simplest way to set up your own knot is to use the provided compose file
3737+and run the following:
3838+3939+```sh
4040+export KNOT_SERVER_HOSTNAME=example.com
4141+export KNOT_SERVER_SECRET=KNOT_TOKEN_HERE
4242+export KNOT_SERVER_PORT=443
4343+docker compose up -d
2944```
30453131-This will for example point caddy to the port on the knot container.
4646+This will setup everything for you including a reverse proxy.
3247