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

+41 -1
+41 -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 build 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 auth, use the `caddy` profile of the compose: 84 + 85 + ```sh 86 + docker compose --profile caddy up -d 87 + ``` 88 + 89 + The knot server will 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 + Thus, when trying to push code to your knot, say `git@knot.example.com/someRepo`, Git will use port 22 by default (which will resolve to your docker host's SSH daemon). 106 + Configure ssh to use the port exposed by your container in `~/.ssh/config`: 107 + 108 + ``` 109 + Host knot.example.com 110 + Port 2222 111 + ``` 112 + 113 + You can then test your configuration using `ssh -T git@knot.example.com`.