docker: fix config #198

closed
opened by knotbin.com targeting master from [deleted fork]: fix-docker

(i be traumatized) fixes knotguard options, along with some more config improvements and fixes in docker compose and dockerfile

Changed files
+20 -3
docker
rootfs
etc
s6-overlay
s6-rc.d
knotserver
run
guard
keyfetch
+1 -1
docker/rootfs/etc/s6-overlay/s6-rc.d/knotserver/run
··· 1 1 #!/command/with-contenv ash 2 2 3 - exec s6-setuidgid git /usr/local/bin/knotserver 3 + exec s6-setuidgid git /usr/local/bin/knot server
+1 -1
guard/guard.go
··· 40 40 &cli.StringFlag{ 41 41 Name: "internal-api", 42 42 Usage: "internal API endpoint", 43 - Value: "http://localhost:5444", 43 + Value: "http://localhost:5555", 44 44 }, 45 45 }, 46 46 }
+1 -1
keyfetch/keyfetch.go
··· 28 28 &cli.StringFlag{ 29 29 Name: "internal-api", 30 30 Usage: "internal API endpoint", 31 - Value: "http://localhost:5444", 31 + Value: "http://127.0.0.1:5444", 32 32 }, 33 33 &cli.StringFlag{ 34 34 Name: "git-dir",
+17
docker/docker-compose.yml
··· 8 8 KNOT_SERVER_SECRET: ${KNOT_SERVER_SECRET} 9 9 KNOT_SERVER_DB_PATH: "/app/knotserver.db" 10 10 KNOT_REPO_SCAN_PATH: "/home/git/repositories" 11 + KNOT_SERVER_INTERNAL_LISTEN_ADDR: "localhost:5444" 11 12 volumes: 12 13 - "./keys:/etc/ssh/keys" 13 14 - "./repositories:/home/git/repositories" ··· 16 17 - "5555:5555" 17 18 - "2222:22" 18 19 restart: always 20 + frontend: 21 + image: caddy:2-alpine 22 + command: > 23 + caddy 24 + reverse-proxy 25 + --from ${KNOT_SERVER_HOSTNAME} 26 + --to knot:5555 27 + depends_on: 28 + - knot 29 + ports: 30 + - "${KNOT_SERVER_PORT:-443}:443" 31 + - "${KNOT_SERVER_PORT:-443}:443/udp" 32 + volumes: 33 + - caddy_data:/data 34 + restart: always 35 + profiles: ["caddy"]