Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (77 loc) · 2.63 KB
/
Copy pathdocker-compose.yml
File metadata and controls
86 lines (77 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Claude Code Discord Bot - Docker Compose Configuration
# Quick start: docker compose up -d
#
# Authentication: ANTHROPIC_API_KEY is required in Docker.
# The bot uses the Claude Agent SDK (no Claude CLI in the image).
# Set ANTHROPIC_API_KEY in your .env file before starting.
#
# To use the pre-built image from GitHub Container Registry (recommended):
# 1. Comment out the 'build' section below
# 2. Uncomment the 'image' line
# 3. Run: docker compose pull && docker compose up -d
services:
claude-bot:
# Option A: Build locally from source (default)
build:
context: .
dockerfile: Dockerfile
args:
# Pass host HEAD so version checks compare a real commit (not a fake /app git repo).
# CI sets this via docker-publish.yml; locally export first if needed:
# export GIT_COMMIT=$(git rev-parse HEAD) # or: $env:GIT_COMMIT = git rev-parse HEAD
GIT_COMMIT: ${GIT_COMMIT:-}
# Option B: Use pre-built image from GHCR (uncomment and remove build above)
# image: ghcr.io/zebbern/claude-code-discord:latest
container_name: claude-code-discord
restart: unless-stopped
# Environment variables (use .env file or set here)
# ANTHROPIC_API_KEY is required — SDK auth (no `claude /login` in this image)
environment:
- DISCORD_TOKEN=${DISCORD_TOKEN}
- APPLICATION_ID=${APPLICATION_ID}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- WORK_DIR=${WORK_DIR:-/app/workspace}
- USER_ID=${USER_ID:-}
- CATEGORY_NAME=${CATEGORY_NAME:-claude-code}
- MONITOR_CHANNEL_ID=${MONITOR_CHANNEL_ID:-}
- MONITOR_BOT_IDS=${MONITOR_BOT_IDS:-}
# Volume mounts for persistence and workspace access
volumes:
# Persist bot data (todos, sessions, etc.)
- bot-data:/app/.bot-data
# Optional SDK / Claude home state
- claude-config:/home/claude/.claude
# Optional: Mount your local workspace for Claude to work on
# Uncomment and modify path as needed:
# - /path/to/your/project:/app/workspace
# Resource limits (adjust based on your needs)
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Security options
security_opt:
- no-new-privileges:true
# Network mode
networks:
- claude-network
# Named volumes for data persistence
volumes:
bot-data:
driver: local
claude-config:
driver: local
# Network configuration
networks:
claude-network:
driver: bridge