From c77d1870979c6f5d7bc9c93a34ea5a7b670278a2 Mon Sep 17 00:00:00 2001 From: Julien WITTOUCK Date: Sat, 2 May 2026 22:07:10 +0200 Subject: [PATCH] readme: update docker-compose usage Signed-off-by: Julien WITTOUCK --- readme.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 9220351..3f0b61f 100644 --- a/readme.md +++ b/readme.md @@ -62,12 +62,53 @@ the command. The simplest way to set up your own knot is to use the provided compose file and run the following: +First, create directories that will be used as docker volumes: + ```sh mkdir keys repositories server +chown -R 1000:1000 keys repositories server +``` + +Replace the `1000:1000` ids if you built your docker image with different ids. + +Then start the knot container using: + +```sh export KNOT_SERVER_HOSTNAME=example.com export KNOT_SERVER_OWNER=did:plc:yourdidgoeshere export KNOT_SERVER_PORT=443 docker compose up -d ``` -This will setup everything for you including a reverse proxy. +If you also want to setup a reverse proxy with TLS termination, use the `caddy` profile of the in the compose file: + +```sh +docker compose --profile caddy up -d +``` + +The knot server will then be exposed on the given port. + +## Pushing code using SSH + +When starting a knot in a docker container, the knot listens to a SSH port that is not the same as the host. +The `docker-compose.yml` file uses port 2222 as an example: + +```yml +services: + knot: + image: atcr.io/tangled.org/knot:latest + ports: + - "5555:5555" + - "2222:22" +``` + +By default, when you push code to a remote, such as `git@knot.example.com/someRepo`, Git will use port 22, which will resolve to your docker host's SSH daemon, not the container. + +To connect to the knot container over Git with SSH, configure your SSH client to use the port exposed by the container in `~/.ssh/config`. + +``` +Host knot.example.com + Port 2222 +``` + +You can then test your configuration using `ssh -T git@knot.example.com`. -- 2.51.2