version: '3.5'

services:
  web:
    image: caddy
    volumes:
      - "./Caddyfile:/etc/caddy/Caddyfile:ro"
    ports:
      - 8080:8080

  tabby:
    restart: always
    image: tabbyml/tabby
    platform: linux/amd64
    command: serve --model TabbyML/T5P-220M
    volumes:
      - "$HOME/.tabby:/data"

  scheduler:
    restart: always
    image: tabbyml/tabby
    platform: linux/amd64
    command: scheduler
    volumes:
      - "$HOME/.tabby:/data"

  klaus:
    restart: always
    image: jonashaag/klaus
    environment:
      KLAUS_REPOS_ROOT: /repos
      KLAUS_SITE_NAME: tabby
    command: |
      sh -c 'git config --global --add safe.directory "*" && pip install gunicorn && gunicorn klaus.contrib.wsgi_autoreload -b 0.0.0.0:8080'
    volumes:
      - "$HOME/.tabby/repositories:/repos:ro"
