# Run a Twigpine node + Postgres locally. For on-chain PoS operation, supply # the operator key + contract addresses via a .env file or shell environment. # Settings are TWIGPINE_*. A .env written before the rename, with GITLAWB_* # names, still works: each value below falls back to the old name. # # An override file is different. A GITLAWB_* entry under `environment:` in # docker-compose.override.yml no longer replaces the entry below, because the # two now have different names, and the node uses the TWIGPINE_* one. Rename # such entries to TWIGPINE_*. The node logs a warning naming each setting it # was given under both names with different values. services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: gitlawb POSTGRES_USER: gitlawb POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} volumes: - pg-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U gitlawb"] interval: 10s timeout: 5s retries: 5 restart: unless-stopped node: build: . # Reap reparented orphan processes so git's grandchildren (e.g. pack-objects # left behind when a served clone disconnects) can't accumulate as zombies # and exhaust the PID table (#53). The image also runs under tini, so this is # belt-and-suspenders for the quickstart. init: true # Cap the process table so a regression fails loudly instead of taking the # host down. Sits well above normal concurrent git fan-out. pids_limit: 1024 depends_on: postgres: condition: service_healthy ports: - "${TWIGPINE_PORT:-${GITLAWB_PORT:-7545}}:${TWIGPINE_PORT:-${GITLAWB_PORT:-7545}}" # HTTP API + git smart-HTTP - "${TWIGPINE_P2P_PORT:-${GITLAWB_P2P_PORT:-7546}}:${TWIGPINE_P2P_PORT:-${GITLAWB_P2P_PORT:-7546}}/udp" # libp2p QUIC volumes: - gitlawb-data:/data environment: DATABASE_URL: postgresql://gitlawb:${POSTGRES_PASSWORD:-changeme}@postgres:5432/gitlawb TWIGPINE_HOST: 0.0.0.0 TWIGPINE_PORT: ${TWIGPINE_PORT:-${GITLAWB_PORT:-7545}} TWIGPINE_PUBLIC_URL: ${TWIGPINE_PUBLIC_URL:-${GITLAWB_PUBLIC_URL:-http://localhost:7545}} TWIGPINE_P2P_PORT: ${TWIGPINE_P2P_PORT:-${GITLAWB_P2P_PORT:-7546}} TWIGPINE_BOOTSTRAP_PEERS: ${TWIGPINE_BOOTSTRAP_PEERS:-${GITLAWB_BOOTSTRAP_PEERS:-}} TWIGPINE_BOOTSTRAP_DISABLE_SEEDS: ${TWIGPINE_BOOTSTRAP_DISABLE_SEEDS:-${GITLAWB_BOOTSTRAP_DISABLE_SEEDS:-false}} TWIGPINE_REQUIRE_SIGNED_PEER_WRITES: ${TWIGPINE_REQUIRE_SIGNED_PEER_WRITES:-${GITLAWB_REQUIRE_SIGNED_PEER_WRITES:-false}} # Owner-only push. The default matches the node's own, so the container path # behaves like a source build; forwarding it is what makes the documented # rolling-upgrade opt-out reachable for an operator running compose. TWIGPINE_ENFORCE_OWNER_PUSH: ${TWIGPINE_ENFORCE_OWNER_PUSH:-${GITLAWB_ENFORCE_OWNER_PUSH:-true}} TWIGPINE_P2P_BOOTSTRAP: ${TWIGPINE_P2P_BOOTSTRAP:-${GITLAWB_P2P_BOOTSTRAP:-}} TWIGPINE_MAX_PACK_BYTES: ${TWIGPINE_MAX_PACK_BYTES:-${GITLAWB_MAX_PACK_BYTES:-2147483648}} # Sync TWIGPINE_AUTO_SYNC: ${TWIGPINE_AUTO_SYNC:-${GITLAWB_AUTO_SYNC:-false}} # On-chain PoS (optional — leave unset for local/dev) TWIGPINE_CHAIN_RPC_URL: ${TWIGPINE_CHAIN_RPC_URL:-${GITLAWB_CHAIN_RPC_URL:-}} TWIGPINE_CONTRACT_NODE_STAKING: ${TWIGPINE_CONTRACT_NODE_STAKING:-${GITLAWB_CONTRACT_NODE_STAKING:-}} TWIGPINE_OPERATOR_PRIVATE_KEY: ${TWIGPINE_OPERATOR_PRIVATE_KEY:-${GITLAWB_OPERATOR_PRIVATE_KEY:-}} TWIGPINE_OPERATOR_STRICT_MODE: ${TWIGPINE_OPERATOR_STRICT_MODE:-${GITLAWB_OPERATOR_STRICT_MODE:-false}} TWIGPINE_HEARTBEAT_INTERVAL_HOURS: ${TWIGPINE_HEARTBEAT_INTERVAL_HOURS:-${GITLAWB_HEARTBEAT_INTERVAL_HOURS:-20}} # Optional shared storage (leave unset to use local disk only) TWIGPINE_TIGRIS_BUCKET: ${TWIGPINE_TIGRIS_BUCKET:-${GITLAWB_TIGRIS_BUCKET:-}} AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-} AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-} AWS_ENDPOINT_URL_S3: ${AWS_ENDPOINT_URL_S3:-} restart: unless-stopped volumes: pg-data: gitlawb-data: