# 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