From 73b9aa3d22d5696366839873d0f8e9c54cd44444 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 14 May 2026 20:50:26 -0500 Subject: Support reverse proxy deployment and general container improvements --- README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8ca3065..b666b8c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,13 @@ ### Docker compose -Bind mount your git repos to `/repos` and a data folder to `/root/.local/share/caddy`. -The only environment variable is `SITE_ADDRESS`. If unset then localhost will be used (which you can't really use since the certs are inside the container). +Bind mount your git repos to `/repos`. + +The `SITE_ADDRESS` environment variable is passed directly to Caddy as the site address. If unset, defaults to `:80` (plain HTTP, no TLS). + +### Standalone (Caddy handles TLS) + +Mount a data folder to `/root/.local/share/caddy` to persist certificates. services: cgit: @@ -17,4 +22,22 @@ The only environment variable is `SITE_ADDRESS`. If unset then localhost will be - ~/repos:/repos - ./data:/root/.local/share/caddy environment: - SITE_ADDRESS: git.soltermann.xyz + SITE_ADDRESS: git.example.com + +### Behind a reverse proxy + +Leave `SITE_ADDRESS` unset (defaults to `:80`). Bind the port to localhost only and let the external proxy handle TLS. + + services: + cgit: + build: ./cgit + ports: + - "127.0.0.1:8080:80" + volumes: + - ~/repos:/repos + +Then in your external Caddyfile: + + git.example.com { + reverse_proxy localhost:8080 + } -- cgit v1.2.3