Skip to content

Instantly share code, notes, and snippets.

@nicolasmendonca
Last active February 21, 2025 12:51
Show Gist options
  • Save nicolasmendonca/65e407d0e99b361739bea7e30f616aab to your computer and use it in GitHub Desktop.
Save nicolasmendonca/65e407d0e99b361739bea7e30f616aab to your computer and use it in GitHub Desktop.
pgai
version: '3.8'
services:
db:
image: timescale/timescaledb-ha:pg17
container_name: timescaledb
restart: always
environment:
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- data:/home/postgres/pgdata/data
command: ["-c", "ai.ollama_host=http://ollama:11434"]
vectorizer-worker:
image: timescale/pgai-vectorizer-worker:latest
container_name: pgai-vectorizer
restart: always
environment:
PGAI_VECTORIZER_WORKER_DB_URL: postgres://postgres:postgres@db:5432/postgres
OLLAMA_HOST: http://ollama:11434
command: ["--poll-interval", "5s", "--log-level", "DEBUG"]
depends_on:
- db
- ollama
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: always
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
entrypoint: ["/bin/sh", "-c"]
command:
- |
apk add --no-cache curl
ollama serve &
sleep 5
ollama pull deepseek-r1:8b
wait
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags" , "&&", "ollama", "list", "|", "grep", "deepseek-r1:8b"]
interval: 30s
timeout: 10s
retries: 30
start_period: 10s
volumes:
data:
driver: local
ollama_data:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment