# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. # # Default path is pure SQLite; Postgres is behind the `postgres` profile # (`docker compose --profile postgres up`). services: fabrica: build: . # Or: image: ghcr.io/you/fabrica:latest restart: unless-stopped ports: - "8080:8080" # Map SSH. The advertised clone port is `ssh.clone_port` in the config, # which may differ from this published port (e.g. behind a forward). - "2222:2222" volumes: - data:/var/lib/fabrica - repos:/var/lib/fabrica/repos # Bind-mount the config; override a couple of keys via env below to # demonstrate both mechanisms. - ./fabrica.toml:/etc/fabrica/fabrica.toml:ro environment: # FABRICA__
__ overrides the file (double underscores nest). FABRICA__INSTANCE__URL: "https://git.example.com" FABRICA__LOG__FORMAT: "json" healthcheck: test: ["CMD", "fabrica", "doctor", "--quiet"] interval: 30s timeout: 5s postgres: image: postgres:16-alpine profiles: ["postgres"] restart: unless-stopped environment: POSTGRES_USER: fabrica POSTGRES_PASSWORD: fabrica POSTGRES_DB: fabrica volumes: - pg:/var/lib/postgresql/data # To use it, point the database URL at this service, e.g.: # FABRICA__DATABASE__URL: "postgres://fabrica:fabrica@postgres/fabrica" volumes: data: repos: pg: # --- Reverse proxy note ------------------------------------------------------ # A proxy in front MUST NOT buffer the git pack routes, or clones stall. For # nginx: # # location / { # proxy_pass http://fabrica:8080; # proxy_http_version 1.1; # # Critical for `/git-upload-pack` and `/info/refs`: # proxy_buffering off; # proxy_request_buffering off; # proxy_read_timeout 3600s; # }