2026-02-22 16:21:32 -05:00
|
|
|
# ── Timmy Time — agent image ────────────────────────────────────────────────
|
|
|
|
|
#
|
|
|
|
|
# Serves two purposes:
|
|
|
|
|
# 1. `make docker-up` → runs the FastAPI dashboard (default CMD)
|
|
|
|
|
# 2. `make docker-agent` → runs a swarm agent worker (override CMD)
|
|
|
|
|
#
|
|
|
|
|
# Build: docker build -t timmy-time:latest .
|
|
|
|
|
# Dash: docker run -p 8000:8000 -v $(pwd)/data:/app/data timmy-time:latest
|
|
|
|
|
# Agent: docker run -e COORDINATOR_URL=http://dashboard:8000 \
|
|
|
|
|
# -e AGENT_NAME=Worker-1 \
|
|
|
|
|
# timmy-time:latest \
|
|
|
|
|
# python -m swarm.agent_runner --agent-id w1 --name Worker-1
|
|
|
|
|
|
2026-02-28 13:12:14 -05:00
|
|
|
# ── Stage 1: Builder — export deps via Poetry, install via pip ──────────────
|
|
|
|
|
FROM python:3.12-slim AS builder
|
2026-02-22 16:21:32 -05:00
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2026-02-28 13:12:14 -05:00
|
|
|
gcc curl \
|
2026-02-22 16:21:32 -05:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2026-02-28 13:12:14 -05:00
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
|
|
# Install Poetry + export plugin (only needed for export, not in runtime)
|
|
|
|
|
RUN pip install --no-cache-dir poetry poetry-plugin-export
|
2026-02-22 16:21:32 -05:00
|
|
|
|
2026-02-28 13:12:14 -05:00
|
|
|
# Copy dependency files only (layer caching)
|
|
|
|
|
COPY pyproject.toml poetry.lock ./
|
2026-02-22 16:21:32 -05:00
|
|
|
|
2026-02-28 13:12:14 -05:00
|
|
|
# Export pinned requirements and install with pip cache mount
|
feat: Phase 1 autonomy upgrades — introspection, heartbeat, source tagging, Discord auto-detect (#101)
UC-01: Live System Introspection Tool
- Add get_task_queue_status(), get_agent_roster(), get_live_system_status()
to timmy/tools_intro with graceful degradation
- Enhanced get_memory_status() with line counts, section headers, vault
directory listing, semantic memory row count, self-coding journal stats
- Register system_status MCP tool (creative/tools/system_status.py)
- Add system_status to Timmy's tool list + Hard Rule #7
UC-02: Fix Offline Status Bug
- Add registry.heartbeat() calls in task_processor run_loop() and
process_single_task() so health endpoint reflects actual agent status
- health.py now consults swarm registry instead of Ollama connectivity
UC-03: Message Source Tagging
- Add source field to Message dataclass (default "browser")
- Tag all message_log.append() calls: browser, api, system
- Include source in /api/chat/history response
UC-04: Discord Token Auto-Detection & Docker Fix
- Add _discord_token_watcher() background coroutine that polls every 30s
for DISCORD_TOKEN in env vars, .env file, or state file
- Add --extras discord to all three Dockerfiles (main, dashboard, test)
All 26 Phase 1 tests pass in Docker (make test-docker).
Full suite: 1889 passed, 77 skipped, 0 failed.
Co-authored-by: Alexander Payne <apayne@MM.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:49:24 -05:00
|
|
|
RUN poetry export --extras swarm --extras telegram --extras discord --without-hashes \
|
2026-02-28 13:12:14 -05:00
|
|
|
-f requirements.txt -o requirements.txt
|
|
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# ── Stage 2: Runtime ───────────────────────────────────────────────────────
|
|
|
|
|
FROM python:3.12-slim AS base
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
curl fonts-dejavu-core \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
2026-02-25 18:08:57 +00:00
|
|
|
|
2026-02-28 13:12:14 -05:00
|
|
|
# Copy installed packages from builder
|
|
|
|
|
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
|
|
|
|
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
2026-02-22 16:21:32 -05:00
|
|
|
|
|
|
|
|
# ── Application source ───────────────────────────────────────────────────────
|
|
|
|
|
COPY src/ ./src/
|
|
|
|
|
COPY static/ ./static/
|
|
|
|
|
|
|
|
|
|
# Create data directory (mounted as a volume in production)
|
|
|
|
|
RUN mkdir -p /app/data
|
|
|
|
|
|
feat: one-click cloud deployment — Caddy HTTPS, Ollama, systemd, cloud-init
Add complete production deployment stack so Timmy can be deployed to any
cloud provider (DigitalOcean, AWS, Hetzner, etc.) with a single command.
New files:
- docker-compose.prod.yml: production stack (Caddy auto-HTTPS, Ollama LLM,
Dashboard, Timmy agent, Watchtower auto-updates)
- deploy/Caddyfile: reverse proxy with security headers and WebSocket support
- deploy/setup.sh: interactive one-click setup script for any Ubuntu/Debian server
- deploy/cloud-init.yaml: paste as User Data when creating a cloud VM
- deploy/timmy.service: systemd unit for auto-start on boot
- deploy/digitalocean/create-droplet.sh: create a DO droplet via doctl CLI
Updated:
- Dockerfile: non-root user, healthcheck, missing deps (GitPython, moviepy, redis)
- Makefile: cloud-deploy, cloud-up/down/logs/status/update/scale targets
- .env.example: DOMAIN setting for HTTPS
- .dockerignore: exclude deploy configs from image
https://claude.ai/code/session_018CduUZoEJzFynBwMsxaP8T
2026-02-24 21:22:56 +00:00
|
|
|
# ── Non-root user for production ─────────────────────────────────────────────
|
|
|
|
|
RUN groupadd -r timmy && useradd -r -g timmy -d /app -s /sbin/nologin timmy \
|
|
|
|
|
&& chown -R timmy:timmy /app
|
2026-02-28 07:39:31 -05:00
|
|
|
# Ensure static/ and data/ are world-readable so bind-mounted files
|
|
|
|
|
# from the macOS host remain accessible when running as the timmy user.
|
|
|
|
|
RUN chmod -R o+rX /app/static /app/data
|
feat: one-click cloud deployment — Caddy HTTPS, Ollama, systemd, cloud-init
Add complete production deployment stack so Timmy can be deployed to any
cloud provider (DigitalOcean, AWS, Hetzner, etc.) with a single command.
New files:
- docker-compose.prod.yml: production stack (Caddy auto-HTTPS, Ollama LLM,
Dashboard, Timmy agent, Watchtower auto-updates)
- deploy/Caddyfile: reverse proxy with security headers and WebSocket support
- deploy/setup.sh: interactive one-click setup script for any Ubuntu/Debian server
- deploy/cloud-init.yaml: paste as User Data when creating a cloud VM
- deploy/timmy.service: systemd unit for auto-start on boot
- deploy/digitalocean/create-droplet.sh: create a DO droplet via doctl CLI
Updated:
- Dockerfile: non-root user, healthcheck, missing deps (GitPython, moviepy, redis)
- Makefile: cloud-deploy, cloud-up/down/logs/status/update/scale targets
- .env.example: DOMAIN setting for HTTPS
- .dockerignore: exclude deploy configs from image
https://claude.ai/code/session_018CduUZoEJzFynBwMsxaP8T
2026-02-24 21:22:56 +00:00
|
|
|
USER timmy
|
|
|
|
|
|
2026-02-22 16:21:32 -05:00
|
|
|
# ── Environment ──────────────────────────────────────────────────────────────
|
|
|
|
|
ENV PYTHONPATH=/app/src
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
feat: one-click cloud deployment — Caddy HTTPS, Ollama, systemd, cloud-init
Add complete production deployment stack so Timmy can be deployed to any
cloud provider (DigitalOcean, AWS, Hetzner, etc.) with a single command.
New files:
- docker-compose.prod.yml: production stack (Caddy auto-HTTPS, Ollama LLM,
Dashboard, Timmy agent, Watchtower auto-updates)
- deploy/Caddyfile: reverse proxy with security headers and WebSocket support
- deploy/setup.sh: interactive one-click setup script for any Ubuntu/Debian server
- deploy/cloud-init.yaml: paste as User Data when creating a cloud VM
- deploy/timmy.service: systemd unit for auto-start on boot
- deploy/digitalocean/create-droplet.sh: create a DO droplet via doctl CLI
Updated:
- Dockerfile: non-root user, healthcheck, missing deps (GitPython, moviepy, redis)
- Makefile: cloud-deploy, cloud-up/down/logs/status/update/scale targets
- .env.example: DOMAIN setting for HTTPS
- .dockerignore: exclude deploy configs from image
https://claude.ai/code/session_018CduUZoEJzFynBwMsxaP8T
2026-02-24 21:22:56 +00:00
|
|
|
# ── Healthcheck ──────────────────────────────────────────────────────────────
|
2026-02-28 15:01:48 -05:00
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
feat: one-click cloud deployment — Caddy HTTPS, Ollama, systemd, cloud-init
Add complete production deployment stack so Timmy can be deployed to any
cloud provider (DigitalOcean, AWS, Hetzner, etc.) with a single command.
New files:
- docker-compose.prod.yml: production stack (Caddy auto-HTTPS, Ollama LLM,
Dashboard, Timmy agent, Watchtower auto-updates)
- deploy/Caddyfile: reverse proxy with security headers and WebSocket support
- deploy/setup.sh: interactive one-click setup script for any Ubuntu/Debian server
- deploy/cloud-init.yaml: paste as User Data when creating a cloud VM
- deploy/timmy.service: systemd unit for auto-start on boot
- deploy/digitalocean/create-droplet.sh: create a DO droplet via doctl CLI
Updated:
- Dockerfile: non-root user, healthcheck, missing deps (GitPython, moviepy, redis)
- Makefile: cloud-deploy, cloud-up/down/logs/status/update/scale targets
- .env.example: DOMAIN setting for HTTPS
- .dockerignore: exclude deploy configs from image
https://claude.ai/code/session_018CduUZoEJzFynBwMsxaP8T
2026-02-24 21:22:56 +00:00
|
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
|
|
2026-02-22 16:21:32 -05:00
|
|
|
# ── Default: run the dashboard ───────────────────────────────────────────────
|
|
|
|
|
CMD ["uvicorn", "dashboard.app:app", "--host", "0.0.0.0", "--port", "8000"]
|