servers:
  web:
    hosts:
      - fizzy-app-101.df-iad-int.37signals.com
      - fizzy-app-102.df-iad-int.37signals.com
      - fizzy-app-01.sc-chi-int.37signals.com
      - fizzy-app-02.sc-chi-int.37signals.com
      - fizzy-app-401.df-ams-int.37signals.com
      - fizzy-app-402.df-ams-int.37signals.com
    labels:
      otel_scrape_enabled: true
  jobs:
    hosts:
      - fizzy-app-101.df-iad-int.37signals.com
    options:
      # NFS mount for backups
      # See https://3.basecamp.com/2914079/buckets/37331921/todos/9175385847
      mount: type=volume,src=backups,dst=/backups,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/fizzy-production-backups,"volume-opt=o=addr=purestorage.sc-chi-int.37signals.com,nfsvers=3,rw,noatime,nconnect=8,soft,timeo=30,retrans=2"
    labels:
      otel_scrape_enabled: true

proxy:
  ssl: false

ssh:
  user: app

env:
  clear:
    RAILS_ENV: production

accessories:
  beamer:
    image: basecamp/beamer:vfs
    registry:
      server: registry.37signals.com
      username: robot$harbor-bot
      password:
        - BASECAMP_REGISTRY_PASSWORD
    labels:
      otel_role: beamer
      otel_service: fizzy-beamer
      otel_scrape_enabled: true
    options:
      user: 1000 # Match the UID of the Rails app, for volume permissions
      publish:
        - 5001:5001
        - 9000:9000
    volumes:
      - fizzy:/home/beamer
    cmd: beamer run --retention=1h --metrics-port=9000
    hosts:
      - fizzy-app-101.df-iad-int.37signals.com
      - fizzy-app-102.df-iad-int.37signals.com
      - fizzy-app-01.sc-chi-int.37signals.com
      - fizzy-app-02.sc-chi-int.37signals.com
      - fizzy-app-401.df-ams-int.37signals.com
      - fizzy-app-402.df-ams-int.37signals.com

  load-balancer:
    image: basecamp/kamal-proxy:lb
    hosts:
      - fizzy-lb-101.df-iad-int.37signals.com
      - fizzy-lb-01.sc-chi-int.37signals.com
      - fizzy-lb-401.df-ams-int.37signals.com
    labels:
      otel_role: load-balancer
      otel_service: fizzy-load-balancer
      otel_scrape_enabled: true
    options:
      publish:
        - 80:80
        - 443:443
      # NFS mount for certificates
      # See https://3.basecamp.com/2914079/buckets/37331921/todos/9180260061
      mount: type=volume,src=certificates,dst=/certificates,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/fizzy-production-certificates,"volume-opt=o=addr=purestorage.sc-chi-int.37signals.com,nfsvers=3,rw,noatime,nconnect=8,soft,timeo=30,retrans=2"
    volumes:
      - load-balancer:/home/kamal-proxy/.config/kamal-proxy
