-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathdocker-compose.user.yaml
More file actions
122 lines (117 loc) · 3.81 KB
/
docker-compose.user.yaml
File metadata and controls
122 lines (117 loc) · 3.81 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
# 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
# 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
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 256M
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:
qdrant_data:
ollama_data:
networks:
phantom-net:
driver: bridge