Luigit
repositories / will

will

owned by admin

compose.yaml

Raw
# Workstation development body: service + agent + fake telegram + dev genome.
#
# Genome flow (prod-parity, fully offline, your workspace never touched by will):
#   git-init  1. seeds ./.dev/origin.git (bare) from your checkout's commits
#             2. clones it to ./.dev/work (the dev workspace, persists across boots)
#             3. copies node_modules once (293M, only when missing)
#             4. overlays your uncommitted files into ./.dev/work and commits them
#                as 'dev-sync' -- but only when the dev workspace is clean, so
#                will's uncommitted work is never clobbered
#   agent     lives in ./.dev/work: edits, commits, pushes to ./.dev/origin.git
#   you       inspect anytime: cd .dev/work && git log / git diff
services:
  service:
    image: docker.io/library/node:26-slim
    working_dir: /workspace
    command: node --experimental-strip-types src/service/main.ts
    environment:
      WILL_SERVICE_DATA_DIR: /srv/will-data
      WILL_SERVICE_PUBLIC_ADDR: 0.0.0.0:3000
      # dev only: 0.0.0.0 so the published debug port reaches it
      # (prod binds 127.0.0.1 inside the pod netns; see deploy/quadlet)
      WILL_SERVICE_INTERNAL_ADDR: 0.0.0.0:3001
      WILL_SERVICE_WEB_DIST: /workspace/web/dist
      WILL_SERVICE_DOCS_DIST: /workspace/docs/dist
      # dev workstation sits at ~84% disk usage; prod-like 20/10 would cry wolf
      WILL_STORAGE_WARN_PCT: 10
      WILL_STORAGE_STOP_PCT: 5
    volumes:
      - .:/workspace
      - ./.dev/service-data:/srv/will-data
    ports:
      - '3000:3000'
      - '127.0.0.1:33001:3001'
      # agent shares this netns; publish its readiness for host debugging
      - '127.0.0.1:33081:8081'

  git-init:
    build:
      context: ./deploy/dev
      dockerfile: agent.df
    command: sh /scripts/git-init.sh
    environment:
      WILL_INIT_STAY_ALIVE: '1'
    healthcheck:
      test: [CMD-SHELL, "test -f /tmp/git-init-ready"]
      interval: 1s
      timeout: 1s
      retries: 120
    volumes:
      - .:/workspace:ro
      - ./.dev:/will-dev
      - ./deploy/dev/git-init.sh:/scripts/git-init.sh:ro

  agent:
    build:
      context: ./deploy/dev
      dockerfile: agent.df
    working_dir: /will-dev/work
    depends_on:
      service:
        condition: service_started
      git-init:
        condition: service_healthy
    # Shares the service's network namespace (like the production pod):
    # the pod-local API is 127.0.0.1, the fake telegram resolves by name.
    network_mode: "service:service"
    command: sh -c "until [ -f /will-resources/.ready ]; do sleep 0.5; done; exec node --experimental-strip-types /will-dev/work/src/agent/main.ts"
    environment:
      # real session whenever the key is present; WILL_SESSION_MODE=fake forces fake
      WILL_SESSION_MODE: ${WILL_SESSION_MODE:-}
      ZAI_API_KEY: ${ZAI_API_KEY:-}
      ZAI_ANALYSIS_MODEL: ${ZAI_ANALYSIS_MODEL:-}
      ZAI_THINKING_LEVEL: ${ZAI_THINKING_LEVEL:-}
      WILL_AGENT_DIR: /will-dev/agent
      # dev genome: will's own clone; commit+push loops run against the dev origin
      WILL_WORK_DIR: /will-dev/work
      WILL_RESOURCE_DIR: /will-resources
      WILL_VCS_GIT_URL: /will-dev/origin/will.git
      WILL_VCS_DEFAULT_BRANCH: trunk
      WILL_SERVICE_INTERNAL_URL: http://127.0.0.1:3001
      # dev only: bind all interfaces so the published debug port reaches it
      WILL_AGENT_READY_ADDR: 0.0.0.0:8081
      WILL_TELEGRAM_API_BASE: http://fake-telegram:38080
      WILL_TELEGRAM_TOKEN: dev-token
      WILL_TELEGRAM_CHAT_ID: '-100'
      WILL_TELEGRAM_OLIVER_ID: '1'
      GIT_AUTHOR_NAME: will
      GIT_AUTHOR_EMAIL: will@bugabinga.net
      GIT_COMMITTER_NAME: will
      GIT_COMMITTER_EMAIL: will@bugabinga.net
    volumes:
      # The real workspace and its local Pi settings are deliberately absent.
      - ./.dev/work:/will-dev/work
      - ./.dev/origin:/will-dev/origin
      - ./.dev/agent:/will-dev/agent
      - ./.dev/resources:/will-resources:ro

  fake-telegram:
    build:
      context: ./deploy/fake
    environment:
      PORT: 38080
    ports:
      - '38080:38080'