feat(docker): compose file and .env.example for Coolify

One bot service with init: true, 1 GB /dev/shm, three named volumes and every setting as an environment variable; PLAYWRIGHT_ENABLED follows INSTALL_PLAYWRIGHT. .env is git-ignored.
This commit is contained in:
EugeneTes
2026-09-27 12:12:49 +02:00
parent 9a9e55f783
commit 2461dfebce
3 changed files with 82 additions and 0 deletions

42
docker-compose.yml Normal file
View File

@@ -0,0 +1,42 @@
services:
bot:
build:
context: .
args:
INSTALL_PLAYWRIGHT: ${INSTALL_PLAYWRIGHT:-true}
CLAUDE_CODE_VERSION: ${CLAUDE_CODE_VERSION:-2.1}
restart: unless-stopped
# dotnet does not reap orphans; killed `claude` trees and bash tool children would pile up as zombies.
# docker-init runs as root (the image user), so the agent can't read its /proc/1/environ.
init: true
# Chromium crashes with Docker's 64 MB /dev/shm.
shm_size: 1gb
stop_grace_period: 30s
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- TELEGRAM_ALLOWED_USER_IDS=${TELEGRAM_ALLOWED_USER_IDS}
- Telegram__Model=${TELEGRAM_MODEL:-claude-code/claude-opus-5-5}
- TZ=${TZ:-UTC}
- Logging__LogLevel__Default=${LOG_LEVEL:-Information}
# Optional features; empty means off / default.
- OPENAI_API_KEY=${OPENAI_API_KEY:-} # speech to text (attachments spec)
- STT_MODEL=${STT_MODEL:-}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID:-} # Google Calendar (calendar spec)
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET:-}
- DEFAULT_TIMEZONE=${DEFAULT_TIMEZONE:-} # chats' default zone (scheduler spec §7); empty → TZ
- PROCESS_ENV_ALLOW=${PROCESS_ENV_ALLOW:-} # deny-listed variables the agent may see, e.g. GH_TOKEN
# Playwright MCP preset (MCP spec). Enabled when the image has it; the preinstalled binary, no npx download.
- PLAYWRIGHT_ENABLED=${PLAYWRIGHT_ENABLED:-${INSTALL_PLAYWRIGHT:-true}}
- PLAYWRIGHT_HEADLESS=${PLAYWRIGHT_HEADLESS:-true} # no display in the container
- PLAYWRIGHT_BROWSER=${PLAYWRIGHT_BROWSER:-}
- PLAYWRIGHT_EXTRA_ARGS=${PLAYWRIGHT_EXTRA_ARGS:---no-sandbox}
- PLAYWRIGHT_COMMAND=${PLAYWRIGHT_COMMAND:-playwright-mcp}
volumes:
- workspaces:/data/workspaces
- agent:/data/agent
- claude:/data/claude
volumes:
workspaces:
agent:
claude: