- Integrate ollama + ai-gateway into root docker-compose.yml (NVIDIA GPU runtime, single compose for all services) - Change NAS mount from SMB (NAS_SMB_PATH) to NFS (NAS_NFS_PATH) Default: /mnt/nas/Document_Server (fstab registered on GPU server) - Update config.yaml AI endpoints: primary → Mac mini MLX via Tailscale (100.76.254.116:8800) fallback/embedding/vision/rerank → ollama (same Docker network) gateway → ai-gateway (same Docker network) - Update credentials.env.example (remove GPU_SERVER_IP, add NFS path) - Mark gpu-server/docker-compose.yml as deprecated - Update CLAUDE.md network diagram and AI model config - Update architecture.md, deploy.md, devlog.md for GPU server as main - Caddyfile: auto_https off, HTTP only (TLS at upstream proxy) - Caddy port: 127.0.0.1:8080:80 (localhost only) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
106 lines
2.5 KiB
YAML
106 lines
2.5 KiB
YAML
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d
|
|
environment:
|
|
POSTGRES_DB: pkm
|
|
POSTGRES_USER: pkm
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
ports:
|
|
- "15432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U pkm"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
kordoc-service:
|
|
build: ./services/kordoc
|
|
ports:
|
|
- "3100:3100"
|
|
volumes:
|
|
- ${NAS_NFS_PATH:-/mnt/nas/Document_Server}:/documents:ro
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:3100/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
ollama:
|
|
image: ollama/ollama
|
|
volumes:
|
|
- ollama_data:/root/.ollama
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
ports:
|
|
- "11434:11434"
|
|
restart: unless-stopped
|
|
|
|
ai-gateway:
|
|
build: ./gpu-server/services/ai-gateway
|
|
ports:
|
|
- "8081:8080"
|
|
environment:
|
|
- PRIMARY_ENDPOINT=http://100.76.254.116:8800/v1/chat/completions
|
|
- FALLBACK_ENDPOINT=http://ollama:11434/v1/chat/completions
|
|
- CLAUDE_API_KEY=${CLAUDE_API_KEY:-}
|
|
- DAILY_BUDGET_USD=${DAILY_BUDGET_USD:-5.00}
|
|
depends_on:
|
|
- ollama
|
|
restart: unless-stopped
|
|
|
|
fastapi:
|
|
build: ./app
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ${NAS_NFS_PATH:-/mnt/nas/Document_Server}:/documents
|
|
- ./config.yaml:/app/config.yaml:ro
|
|
- ./scripts:/app/scripts:ro
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
kordoc-service:
|
|
condition: service_healthy
|
|
env_file:
|
|
- credentials.env
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://pkm:${POSTGRES_PASSWORD}@postgres:5432/pkm
|
|
- KORDOC_ENDPOINT=http://kordoc-service:3100
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
- fastapi
|
|
restart: unless-stopped
|
|
|
|
caddy:
|
|
image: caddy:2
|
|
ports:
|
|
- "127.0.0.1:8080:80"
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
- caddy_data:/data
|
|
depends_on:
|
|
- fastapi
|
|
- frontend
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|
|
caddy_data:
|
|
ollama_data:
|