name: mtt-harness services: postgres: restart: unless-stopped image: mtt-postgres-vector:16-0.8.1 build: context: . dockerfile: docker/postgres.Dockerfile environment: POSTGRES_USER: ${MTT_DB_USER:-mtt} POSTGRES_PASSWORD: ${MTT_DB_PASSWORD:-mtt} POSTGRES_DB: ${MTT_DB_NAME:-mtt} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""] interval: 2s timeout: 3s retries: 30 mtt: init: true restart: unless-stopped stop_grace_period: 60s build: . user: "${MTT_UID:-1000}:${MTT_GID:-1000}" # Deployment values and the benchmark switch come from the local .env file. environment: MTT_READ_LINE_NUMBERS: ${MTT_READ_LINE_NUMBERS:-false} command: - --config - /etc/mtt/mtt.json - --providers-file - /etc/mtt/providers.json - --mcp-file - /etc/mtt/mcp.json - --start-prompt-file - /etc/mtt/start_prompt.md - --spaced-repetition-prompts - /etc/mtt/spaced-repetition - --sidekick-prompt-file - /etc/mtt/sidekick.md - --database-url - postgres://${MTT_DB_USER:-mtt}:${MTT_DB_PASSWORD:-mtt}@postgres:5432/${MTT_DB_NAME:-mtt}?sslmode=disable - --port - "8080" - --test-provider=${MTT_TEST_PROVIDER:-false} ports: - "${MTT_HOST_PORT:-18080}:8080" volumes: - type: bind source: ${MTT_WORKSPACE_DIR:-./workspace} target: /workspace bind: create_host_path: false - type: bind source: ./mtt.json target: /etc/mtt/mtt.json read_only: true bind: create_host_path: false - type: bind source: ./providers.json target: /etc/mtt/providers.json read_only: true bind: create_host_path: false - type: bind source: ./mcp.json target: /etc/mtt/mcp.json read_only: true bind: create_host_path: false - type: bind source: ./start_prompt.md target: /etc/mtt/start_prompt.md read_only: true bind: create_host_path: false - type: bind source: ./plugins/spaced_repetition/prompts target: /etc/mtt/spaced-repetition read_only: true bind: create_host_path: false - type: bind source: ./plugins/sidekick/prompt.md target: /etc/mtt/sidekick.md read_only: true bind: create_host_path: false depends_on: postgres: condition: service_healthy extra_hosts: - "host.docker.internal:host-gateway" healthcheck: test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/health"] interval: 5s timeout: 3s retries: 12 start_period: 60s ui: extends: file: ui/compose.yaml service: ui # Keep the UI image/proxy owned by ui/, with explicit root-relative context. build: context: ./ui environment: HARNESS_UPSTREAM: http://mtt:8080 depends_on: mtt: condition: service_healthy postgres-test: profiles: ["test"] image: mtt-postgres-vector:16-0.8.1 build: context: . dockerfile: docker/postgres.Dockerfile environment: POSTGRES_USER: mtt POSTGRES_PASSWORD: mtt POSTGRES_DB: mtt_test tmpfs: - /var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U mtt -d mtt_test"] interval: 2s timeout: 3s retries: 30 test: init: true profiles: ["test"] build: context: . target: builder environment: CGO_ENABLED: "1" MTT_TEST_DATABASE_URL: postgres://mtt:mtt@postgres-test:5432/mtt_test?sslmode=disable MTT_TEST_SEARCH_MODEL_DIRECTORY: /opt/mtt/models/all-MiniLM-L6-v2 MTT_TEST_CONTEXT_MODEL_DIRECTORY: /opt/mtt/models/embeddinggemma-2 MTT_TEST_CONTEXT_RUNTIME_LIBRARY: /opt/mtt/lib/libonnxruntime.so.1.30.0 command: ["go", "test", "-tags", "semantic,gemma", "./..."] depends_on: postgres-test: condition: service_healthy volumes: pgdata: