aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: b666b8c06eff275e8d5bb93d330da80e1e41471c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# My cgit docker container

## Usage

### Docker compose

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:
        build: ./cgit
        ports:
          - "443:443"
          - "80:80"
        volumes:
          - ~/repos:/repos
          - ./data:/root/.local/share/caddy
        environment:
          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
    }