Self-hosted Docker Compose stack for DGX Spark (ARM64/aarch64, CPU-only): - SearXNG on port 8889 with JSON API enabled, rate limiting off - Firecrawl (built from local source) on port 3002, no API key required - HHEM API (FastAPI + vectara/hallucination_evaluation_model) on port 8881 - Portainer stack YAML using dgx_net external network - build-images.sh to pre-build local images before Portainer deploy - HF model cache bind-mounted from /home/sparky/LLMs/huggingface Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
179 lines
5.0 KiB
YAML
179 lines
5.0 KiB
YAML
name: ai-tools-stack
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Shared build env for Firecrawl services (all built from local source)
|
|
# ---------------------------------------------------------------------------
|
|
x-firecrawl-build: &firecrawl-build
|
|
build:
|
|
context: /home/sparky/Docker/firecrawl/git/firecrawl/apps/api
|
|
dockerfile: Dockerfile
|
|
|
|
x-firecrawl-env: &firecrawl-env
|
|
USE_DB_AUTHENTICATION: "false"
|
|
REDIS_URL: redis://firecrawl-redis:6379
|
|
REDIS_RATE_LIMIT_URL: redis://firecrawl-redis:6379
|
|
PLAYWRIGHT_MICROSERVICE_URL: http://firecrawl-playwright:3000/scrape
|
|
NUQ_DATABASE_URL: postgres://postgres:postgres@firecrawl-postgres:5432/postgres
|
|
BULL_AUTH_KEY: "aitools-bull-changeme"
|
|
HOST: "0.0.0.0"
|
|
PORT: "3002"
|
|
NODE_ENV: production
|
|
# Wire SearXNG so Firecrawl's /search uses it instead of direct Google
|
|
SEARXNG_ENDPOINT: http://searxng:8080
|
|
|
|
networks:
|
|
ai-tools:
|
|
name: ai-tools
|
|
driver: bridge
|
|
|
|
volumes:
|
|
searxng-cache:
|
|
firecrawl-redis-data:
|
|
firecrawl-pg-data:
|
|
hhem-model-cache:
|
|
|
|
services:
|
|
|
|
# =========================================================================
|
|
# 1. SearXNG — meta-search engine with JSON API
|
|
# =========================================================================
|
|
searxng:
|
|
image: docker.io/searxng/searxng:latest
|
|
container_name: searxng
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8888:8080"
|
|
volumes:
|
|
- ./searxng:/etc/searxng:rw
|
|
- searxng-cache:/var/cache/searxng:rw
|
|
environment:
|
|
- SEARXNG_BASE_URL=http://localhost:8888/
|
|
cap_drop:
|
|
- ALL
|
|
cap_add:
|
|
- CHOWN
|
|
- SETGID
|
|
- SETUID
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/healthz || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
networks:
|
|
- ai-tools
|
|
|
|
# =========================================================================
|
|
# 2. Firecrawl — web scraper (self-hosted, no external API key)
|
|
# Built from local source at /home/sparky/Docker/firecrawl/git/firecrawl/
|
|
# =========================================================================
|
|
|
|
firecrawl-redis:
|
|
image: redis:7-alpine
|
|
container_name: firecrawl-redis
|
|
restart: unless-stopped
|
|
command: redis-server --bind 0.0.0.0 --save 60 1 --loglevel warning
|
|
volumes:
|
|
- firecrawl-redis-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
networks:
|
|
- ai-tools
|
|
|
|
firecrawl-postgres:
|
|
build:
|
|
context: /home/sparky/Docker/firecrawl/git/firecrawl/apps/nuq-postgres
|
|
dockerfile: Dockerfile
|
|
container_name: firecrawl-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: postgres
|
|
volumes:
|
|
- firecrawl-pg-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- ai-tools
|
|
|
|
firecrawl-playwright:
|
|
build:
|
|
context: /home/sparky/Docker/firecrawl/git/firecrawl/apps/playwright-service-ts
|
|
dockerfile: Dockerfile
|
|
container_name: firecrawl-playwright
|
|
restart: unless-stopped
|
|
environment:
|
|
PORT: 3000
|
|
shm_size: "2gb"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
networks:
|
|
- ai-tools
|
|
|
|
firecrawl-api:
|
|
<<: *firecrawl-build
|
|
container_name: firecrawl-api
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3002:3002"
|
|
environment:
|
|
<<: *firecrawl-env
|
|
command: node dist/src/harness.js --start-docker
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
ulimits:
|
|
nofile:
|
|
soft: 65535
|
|
hard: 65535
|
|
depends_on:
|
|
firecrawl-redis:
|
|
condition: service_healthy
|
|
firecrawl-postgres:
|
|
condition: service_healthy
|
|
firecrawl-playwright:
|
|
condition: service_started
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:3002/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 60s
|
|
networks:
|
|
- ai-tools
|
|
|
|
# =========================================================================
|
|
# 3. HHEM API — hallucination evaluator (Vectara, CPU-only)
|
|
# =========================================================================
|
|
hhem-api:
|
|
build:
|
|
context: ./hhem-api
|
|
dockerfile: Dockerfile
|
|
container_name: hhem-api
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8881:8881"
|
|
volumes:
|
|
# Cache downloaded model weights across restarts
|
|
- hhem-model-cache:/root/.cache/huggingface
|
|
environment:
|
|
- HF_HOME=/root/.cache/huggingface
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8881/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 120s # model download on first start
|
|
networks:
|
|
- ai-tools
|