services: postgres: restart: unless-stopped networks: [database] logging: &bounded-logs driver: json-file options: {max-size: "10m", max-file: "3"} image: pgvector/pgvector:pg16 environment: POSTGRES_USER: lazyboy POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-lazyboy} POSTGRES_DB: lazyboy volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U lazyboy"] interval: 3s timeout: 5s retries: 20 computer: image: lazyboy/computer:local build: context: . dockerfile: image/computer/Dockerfile command: ["true"] restart: "no" network_mode: none supervisor: restart: unless-stopped init: true networks: [control] logging: *bounded-logs security_opt: ["no-new-privileges:true"] cap_drop: [ALL] cap_add: [CHOWN, DAC_OVERRIDE] read_only: true healthcheck: test: ["CMD", "/usr/local/bin/lazyboy-supervisor", "--healthcheck"] interval: 5s timeout: 4s retries: 12 build: context: . dockerfile: image/supervisor/Dockerfile environment: SANDBOX_SUPERVISOR_TOKEN: ${SANDBOX_SUPERVISOR_TOKEN:?Set SANDBOX_SUPERVISOR_TOKEN in .env} LAZYBOY_COMPUTER_IMAGE: lazyboy/computer:local LAZYBOY_COMPUTER_CPUS: ${LAZYBOY_COMPUTER_CPUS:-2} LAZYBOY_COMPUTER_MEMORY_MB: ${LAZYBOY_COMPUTER_MEMORY_MB:-2048} LAZYBOY_COMPUTER_PIDS: ${LAZYBOY_COMPUTER_PIDS:-2048} LAZYBOY_COMPUTER_SUDO: ${LAZYBOY_COMPUTER_SUDO:-false} LAZYBOY_LXCFS_ROOT: /var/lib/lxcfs SUPERVISOR_BIND: 0.0.0.0:7091 DATA_DIR: /data HOST_DATA_DIR: ${LAZYBOY_HOST_DATA_DIR:-${PWD}/data} LAZYBOY_SCREEN_NETWORK: ${LAZYBOY_SCREEN_NETWORK:-lazyboy_screen} volumes: - /var/run/docker.sock:/var/run/docker.sock - ./data:/data - ${LAZYBOY_LXCFS_ROOT:-./data/lxcfs}:/var/lib/lxcfs:ro extra_hosts: - "host.docker.internal:host-gateway" depends_on: computer: condition: service_completed_successfully api: restart: unless-stopped init: true networks: [database, control, egress, screen] logging: *bounded-logs security_opt: ["no-new-privileges:true"] cap_drop: [ALL] pids_limit: 256 build: context: . dockerfile: image/api/Dockerfile environment: DATABASE_URL: postgres://lazyboy:${POSTGRES_PASSWORD:-lazyboy}@postgres:5432/lazyboy SANDBOX_SUPERVISOR_URL: http://supervisor:7091 SANDBOX_SUPERVISOR_TOKEN: ${SANDBOX_SUPERVISOR_TOKEN:?Set SANDBOX_SUPERVISOR_TOKEN in .env} LAZYBOY_APP_TOKEN: ${LAZYBOY_APP_TOKEN:?Set LAZYBOY_APP_TOKEN in .env} LAZYBOY_VAULT_KEY: ${LAZYBOY_VAULT_KEY:-} LAZYBOY_SECURE_COOKIE: ${LAZYBOY_SECURE_COOKIE:-false} SANDBOX_PROVIDER: docker DATA_DIR: /data HOST_DATA_DIR: ${LAZYBOY_HOST_DATA_DIR:-${PWD}/data} API_BIND: 0.0.0.0:3100 XAI_API_KEY: ${XAI_API_KEY:-} OPENCODE_GO_API_KEY: ${OPENCODE_GO_API_KEY:-} OPENAI_API_KEY: ${OPENAI_API_KEY:-} LAZYBOY_MEMORY_ENABLED: ${LAZYBOY_MEMORY_ENABLED:-true} LAZYBOY_MEMORY_MODEL_CACHE: /data/fastembed LAZYBOY_MEMORY_TOP_K: ${LAZYBOY_MEMORY_TOP_K:-8} LAZYBOY_MEMORY_BYTE_BUDGET: ${LAZYBOY_MEMORY_BYTE_BUDGET:-6000} LAZYBOY_EVENT_RETENTION_DAYS: ${LAZYBOY_EVENT_RETENTION_DAYS:-30} LAZYBOY_CHECKPOINT_RETENTION_DAYS: ${LAZYBOY_CHECKPOINT_RETENTION_DAYS:-7} LAZYBOY_RUN_RETENTION_DAYS: ${LAZYBOY_RUN_RETENTION_DAYS:-90} LAZYBOY_RECORDING_RETENTION_DAYS: ${LAZYBOY_RECORDING_RETENTION_DAYS:-30} LAZYBOY_MEMORY_HISTORY_RETENTION_DAYS: ${LAZYBOY_MEMORY_HISTORY_RETENTION_DAYS:-90} LAZYBOY_DB_WARN_MB: ${LAZYBOY_DB_WARN_MB:-1024} LAZYBOY_RUN_SOFT_TURNS: ${LAZYBOY_RUN_SOFT_TURNS:-60} LAZYBOY_RUN_SOFT_EVERY: ${LAZYBOY_RUN_SOFT_EVERY:-120} LAZYBOY_RUN_CAP_TURNS: ${LAZYBOY_RUN_CAP_TURNS:-1000} LAZYBOY_RUN_SOFT_MINUTES: ${LAZYBOY_RUN_SOFT_MINUTES:-75} LAZYBOY_RUN_HARD_MINUTES: ${LAZYBOY_RUN_HARD_MINUTES:-240} LAZYBOY_WEB_DIR: /web LAZYBOY_SCREEN_UPSTREAM: host.docker.internal ORT_DYLIB_PATH: /usr/local/lib/libonnxruntime.so ports: - "${LAZYBOY_BIND_IP:-127.0.0.1}:3101:3100" volumes: - ./data:/data extra_hosts: - "host.docker.internal:host-gateway" depends_on: postgres: condition: service_healthy supervisor: condition: service_healthy volumes: pgdata: networks: database: internal: true control: internal: true egress: {} # API ↔ 電腦 noVNC 專用。桌面代理因此不必繞經只綁主機 loopback 的發布埠。 screen: name: ${LAZYBOY_SCREEN_NETWORK:-lazyboy_screen} internal: true