-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathdocker-compose.user.yaml
More file actions
134 lines (129 loc) · 4.45 KB
/
docker-compose.user.yaml
File metadata and controls
134 lines (129 loc) · 4.45 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Phantom AI Agent - Docker Compose
#
# Run Phantom from Docker Hub without cloning the repo.
#
# Quick start:
# 1. Copy .env.example to .env and fill in your values
# 2. docker compose -f docker-compose.user.yaml up -d
# 3. Check health: curl http://localhost:3100/health
#
# Stop (keeps all data): docker compose -f docker-compose.user.yaml down
# Destroy all data: docker compose -f docker-compose.user.yaml down -v
#
# Docs: https://github.com/ghostwright/phantom
services:
# =========================================================================
# Phantom: The AI agent
# Pulls the pre-built image from Docker Hub. No build step needed.
# =========================================================================
phantom:
image: ghostwright/phantom:latest
container_name: phantom
ports:
- "${PORT:-3100}:3100"
env_file:
- .env
environment:
# These override values in .env so the services can find each other
# inside the Docker network. Do not change these.
- QDRANT_URL=http://qdrant:6333
- OLLAMA_URL=http://ollama:11434
# The container runs as a non-root user. Docker socket access requires
# matching the host's docker group ID. Find yours with:
# Linux: stat -c '%g' /var/run/docker.sock
# macOS: stat -f '%g' /var/run/docker.sock
# Set DOCKER_GID in your .env file if the default (988) does not match.
group_add:
- "${DOCKER_GID:-988}"
# Explicit DNS prevents issues on hosts using systemd-resolved,
# where 127.0.0.53 is unreachable from Docker bridge containers.
dns:
- 1.1.1.1
- 8.8.8.8
volumes:
# Persistent state - survives restarts and redeployments
- phantom_config:/app/config
- phantom_evolved:/app/phantom-config
- phantom_data:/app/data
- phantom_public:/app/public
- phantom_repos:/app/repos
# Claude Code credentials (persists `claude login` across restarts so
# subscription users do not have to re-authenticate on every upgrade).
- phantom_claude:/home/phantom/.claude
# Docker socket lets the agent create sibling containers on the host.
# This is required for code execution and development tasks.
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
qdrant:
condition: service_started
ollama:
condition: service_started
restart: unless-stopped
oom_score_adj: -500
cpu_shares: 2048
deploy:
resources:
limits:
# 8 GiB is sized for peak LLM-judge concurrency: main process plus an
# active agent query subprocess plus up to five Claude Code judge
# subprocesses (observation, regression, constitution, safety, and
# consolidation) spawned via runJudgeQuery. The prior 2 GiB cap
# cgroup-OOM-killed judge subprocesses under evolution load.
memory: 8G
pids: 256
reservations:
memory: 512M
networks:
- phantom-net
# =========================================================================
# Qdrant: Vector database for long-term memory
# Stores episodic, semantic, and procedural memories.
# =========================================================================
qdrant:
image: qdrant/qdrant:latest
container_name: phantom-qdrant
volumes:
- qdrant_data:/qdrant/storage
environment:
- QDRANT__SERVICE__GRPC_PORT=6334
restart: unless-stopped
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 512M
networks:
- phantom-net
# =========================================================================
# Ollama: Local embedding model (nomic-embed-text)
# Generates vector embeddings for memory search. Runs entirely on-device.
# =========================================================================
ollama:
image: ollama/ollama:latest
container_name: phantom-ollama
volumes:
- ollama_data:/root/.ollama
restart: unless-stopped
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 1G
networks:
- phantom-net
# Named volumes persist across container restarts and redeployments.
# "docker compose down" keeps them. "docker compose down -v" destroys them.
volumes:
phantom_config:
phantom_evolved:
phantom_data:
phantom_public:
phantom_repos:
phantom_claude:
qdrant_data:
ollama_data:
networks:
phantom-net:
driver: bridge