Files
home_stack/ai_stack/ollama/docker-compose.yml
T

57 lines
1.6 KiB
YAML

services:
ollama:
build:
context: .
network: host
image: localhost/ollama-server:latest
ports:
- "11434:11434" # Map host port 11434 to container port 11434 (Ollama default)
volumes:
- ./models:/models # Mount a local directory for models
- ollama_data:/usr/share/ollama/.ollama # Persistent storage for Ollama data
container_name: ollama-server
environment:
- OLLAMA_HOST=0.0.0.0
restart: unless-stopped
network_mode: slirp4netns
# Uncomment the following lines if you have NVIDIA GPU support
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
postgres:
image: pgvector/pgvector:pg17
container_name: ollama-postgres
ports:
- "54320:5432"
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- ./postgres-data:/var/lib/postgresql/data
restart: unless-stopped
speaches:
image: ghcr.io/speaches-ai/speaches:latest-cpu
container_name: speaches-server
volumes:
- hf-hub-cache:/home/ubuntu/.cache/huggingface/hub
ports:
- "8900:8000"
# deploy:
# resources:
# reservations:
# # WARN: requires Docker Compose 2.24.2
# # https://docs.docker.com/reference/compose-file/merge/#replace-value
# devices: !override
# - capabilities: ["gpu"]
# driver: cdi
# device_ids:
# - nvidia.com/gpu=all
volumes:
ollama_data:
hf-hub-cache: