# ── Timmy Time — Development Compose ──────────────────────────────────────── # # Services # dashboard FastAPI app (always on) # # Volumes # timmy-data Shared SQLite (data/timmy.db) # # Usage # make docker-build build the image # make docker-up start dashboard only # make docker-down stop everything # make docker-logs tail logs # # ── Security note: root user in dev ───────────────────────────────────────── # This dev compose runs containers as root (user: "0:0") so that # bind-mounted host files (./src, ./static) are readable regardless of # host UID/GID — the #1 cause of 403 errors on macOS. # # ── Ollama host access ────────────────────────────────────────────────────── # By default OLLAMA_URL points to http://host.docker.internal:11434 which # reaches Ollama running on the Docker host (macOS/Windows native). # # Linux: The extra_hosts entry maps host.docker.internal → host-gateway, # which resolves to the host IP on Docker 20.10+. services: # ── Dashboard (FastAPI) ────────────────────────────────────────────────── dashboard: build: . image: timmy-time:latest container_name: timmy-dashboard user: "0:0" # dev only — see security note above ports: - "8000:8000" volumes: - timmy-data:/app/data - ./src:/app/src # live-reload: source changes reflect immediately - ./static:/app/static # live-reload: CSS/asset changes reflect immediately environment: DEBUG: "true" OLLAMA_URL: "${OLLAMA_URL:-http://host.docker.internal:11434}" # Grok (xAI) — opt-in premium cloud backend GROK_ENABLED: "${GROK_ENABLED:-false}" XAI_API_KEY: "${XAI_API_KEY:-}" GROK_DEFAULT_MODEL: "${GROK_DEFAULT_MODEL:-grok-3-fast}" extra_hosts: - "host.docker.internal:host-gateway" # Linux: maps to host IP networks: - timmy-net restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 5s retries: 3 start_period: 30s # ── OpenFang — vendored agent runtime sidecar ──────────────────────────── openfang: build: context: . dockerfile: docker/Dockerfile.openfang image: timmy-openfang:latest container_name: timmy-openfang profiles: - openfang environment: OLLAMA_URL: "${OLLAMA_URL:-http://host.docker.internal:11434}" OPENFANG_DATA_DIR: "/app/data" extra_hosts: - "host.docker.internal:host-gateway" volumes: - openfang-data:/app/data networks: - timmy-net restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 5s retries: 3 start_period: 15s # ── Shared volume ───────────────────────────────────────────────────────────── volumes: timmy-data: driver: local driver_opts: type: none o: bind device: "${PWD}/data" openfang-data: driver: local # ── Internal network ────────────────────────────────────────────────────────── networks: timmy-net: driver: bridge