From 4847d3eb05ab324273d80c4594956b1a79483fe9 Mon Sep 17 00:00:00 2001 From: Leopold Date: Sun, 5 Jul 2026 23:58:26 +0200 Subject: [PATCH] chore: compose polish for Coolify + complete .env.example --- .env.example | 25 +++++++++++++++---------- README.md | 10 ++++++++++ docker-compose.yml | 20 ++++++++++++-------- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/.env.example b/.env.example index c3bb256..0e3362e 100644 --- a/.env.example +++ b/.env.example @@ -1,22 +1,27 @@ -# LLM Configuration +# --- Server --- +HOST=0.0.0.0 +PORT=8000 +LOG_LEVEL=info + +# --- LLM (LiteLLM provider/model) --- LLM_PROVIDER=openrouter -LLM_API_KEY=sk-or-v1-xxx +LLM_API_KEY=sk-or-v1-PLACEHOLDER-replace-before-deploy LLM_MODEL=anthropic/claude-3.5-sonnet LLM_API_BASE= -# MCP Tool Server — URL MUST include the /mcp path (FastMCP HTTP transport). -# Example: http://mcp-tools:8501/mcp (the docker-compose default already includes /mcp) +# --- MCP Tool Server --- +# URL MUST include the /mcp path (FastMCP HTTP transport). MCP_SERVER_URL=http://mcp-tools:8501/mcp +MCP_TIMEOUT=10 -# Auth (CHANGE THIS — must be >=32 chars, must NOT be the default below) +# --- Auth (B1 Boot Guard: must be >=32 chars, NOT 'change-me-in-production') --- # Generate one with: python -c "import secrets;print(secrets.token_urlsafe(32))" -AUTH_TOKEN=change-me-to-something-secure +AUTH_TOKEN=change-me-in-production -# Logging -LOG_LEVEL=info +# --- Storage --- +DB_PATH=/data/agent-platform.db -# Limits +# --- Limits --- MAX_HISTORY_MESSAGES=10 MAX_PARALLEL_AGENTS=5 AGENT_IDLE_TIMEOUT_SEC=300 -MCP_TIMEOUT=10 diff --git a/README.md b/README.md index 7ba4ce3..08656eb 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,13 @@ python server.py - agent-platform: 256 MB RAM, 0.5 CPU - mcp-tools: 128 MB RAM, 0.25 CPU - SQLite: 5-10 MB + +## Deploy (Coolify) + +1. In Coolify: **Projects → New Project** → name it (e.g. `agent-platform`). +2. Inside the project: **Resources → New → Docker Compose**. +3. **Repository URL**: `https://forgejo.media-on.de/Leopoldadmin/agent-platform.git`, **Branch**: `main`. +4. **Domain**: bind a hostname to the `agent-platform` service (Traefik routes via the `expose: 8000` label). +5. **Environment Variables**: set `AUTH_TOKEN` (≥32 chars, NOT `change-me-in-production`) and `LLM_API_KEY`; other vars can keep their `.env.example` defaults. +6. Click **Deploy** — Coolify builds the two images, creates the `agent-data` volume, and brings up the stack. +7. **Health check**: `curl https:///health` returns `{"status":"ok"}` once `mcp-tools` is healthy and `agent-platform` is up. diff --git a/docker-compose.yml b/docker-compose.yml index d6d1141..26b0bc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,23 @@ -version: "3.9" - services: agent-platform: build: ./agent_platform - container_name: agent-platform - ports: - - "8000:8000" + expose: + - "8000" environment: + - HOST=${HOST:-0.0.0.0} + - PORT=${PORT:-8000} - LLM_PROVIDER=${LLM_PROVIDER:-openrouter} - LLM_API_KEY=${LLM_API_KEY} - LLM_MODEL=${LLM_MODEL:-anthropic/claude-3.5-sonnet} - LLM_API_BASE=${LLM_API_BASE:-} - - MCP_SERVER_URL=http://mcp-tools:8501/mcp + - MCP_SERVER_URL=${MCP_SERVER_URL:-http://mcp-tools:8501/mcp} + - MCP_TIMEOUT=${MCP_TIMEOUT:-10} - AUTH_TOKEN=${AUTH_TOKEN} - - DB_PATH=/data/agent-platform.db + - DB_PATH=${DB_PATH:-/data/agent-platform.db} - LOG_LEVEL=${LOG_LEVEL:-info} + - MAX_HISTORY_MESSAGES=${MAX_HISTORY_MESSAGES:-10} + - MAX_PARALLEL_AGENTS=${MAX_PARALLEL_AGENTS:-5} + - AGENT_IDLE_TIMEOUT_SEC=${AGENT_IDLE_TIMEOUT_SEC:-300} volumes: - agent-data:/data depends_on: @@ -29,6 +32,7 @@ services: restart: unless-stopped networks: - agent-net + # Informational only in docker compose standalone; apply via Coolify per-container limits UI deploy: resources: limits: @@ -37,7 +41,6 @@ services: mcp-tools: build: ./mcp_tools - container_name: mcp-tools expose: - "8501" environment: @@ -52,6 +55,7 @@ services: restart: unless-stopped networks: - agent-net + # Informational only in docker compose standalone; apply via Coolify per-container limits UI deploy: resources: limits: