Community maintained Docker config for the knot server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

readme: update docker-compose usage

+42 -1
+42 -1
readme.md
··· 62 62 The simplest way to set up your own knot is to use the provided compose file 63 63 and run the following: 64 64 65 + First, create directories that will be used as docker volumes: 66 + 65 67 ```sh 66 68 mkdir keys repositories server 69 + chown -R 1000:1000 keys repositories server 70 + ``` 71 + 72 + Replace the `1000:1000` ids if you built your docker image with different ids. 73 + 74 + Then start the knot container using: 75 + 76 + ```sh 67 77 export KNOT_SERVER_HOSTNAME=example.com 68 78 export KNOT_SERVER_OWNER=did:plc:yourdidgoeshere 69 79 export KNOT_SERVER_PORT=443 70 80 docker compose up -d 71 81 ``` 72 82 73 - This will setup everything for you including a reverse proxy. 83 + If you also want to setup a reverse proxy with TLS termination, use the `caddy` profile of the in the compose file: 84 + 85 + ```sh 86 + docker compose --profile caddy up -d 87 + ``` 88 + 89 + The knot server will then be exposed on the given port. 90 + 91 + ## Pushing code using SSH 92 + 93 + When starting a knot in a docker container, the knot listens to a SSH port that is not the same as the host. 94 + The `docker-compose.yml` file uses port 2222 as an example: 95 + 96 + ```yml 97 + services: 98 + knot: 99 + image: atcr.io/tangled.org/knot:latest 100 + ports: 101 + - "5555:5555" 102 + - "2222:22" 103 + ``` 104 + 105 + 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. 106 + 107 + 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`. 108 + 109 + ``` 110 + Host knot.example.com 111 + Port 2222 112 + ``` 113 + 114 + You can then test your configuration using `ssh -T git@knot.example.com`.