configs:
  buildkitd-config:
    buildkitd.toml: |
      debug=true
      [gc]
        enabled=false
      [worker.oci]
        enabled=true
        gc=false
        gckeepstorage=1073741824
      [grpc]
        address = [ "tcp://0.0.0.0:8080" ]
        # debugAddress is address for attaching go profiles and debuggers.
        debugAddress = "0.0.0.0:6060"

services:
  buildkitd:
    version: v0
    serviceMesh: false
    image: "moby/buildkit:v0.6.1"
    ports:
    - 8080/http,buildkit,expose=false
    privileged: true
    configs:
    - buildkitd-config:/etc/buildkit
    containers:
    - name: registry
      image: "registry:2"
      env:
      - REGISTRY_HTTP_ADDR=0.0.0.0:80
      ports:
      - 80:80/tcp,registry,expose=false
      volume:
      - rio-registry:/var/lib/registry,persistent=${PERSISTENT}
  webhook:
    version: v0
    global_permissions:
    - "* gitwatcher.cattle.io/gitwatchers"
    - "* gitwatcher.cattle.io/gitcommits"
    - '* configmaps'
    - '* events'
    - get,list pods
    - create,get,list /pods/log
    - secrets
    image: rancher/gitwatcher:v0.4.5
    args:
    - gitwatcher
    - --listen-address
    - :8090
    imagePullPolicy: always
    ports:
    - 8090/http,http-webhook

template:
  envSubst: true
  questions:
  - variable: PERSISTENT
    description: "Use PV to store registry data"
