Files
portainer-core/stacks/core-api.yml
T
2025-12-14 13:36:03 +01:00

93 lines
2.4 KiB
YAML

version: '3.8'
# Core API - OpenAPI-compatible functions and AI orchestration for Open WebUI
# Purpose: Provides OpenAI-compatible API (/v1/chat/completions) and tool functions (web scraping)
# Port: 8083 (HTTP API)
# Network: docker-dataplane (shared infrastructure network)
#
# Container image built from: git.schweitz.internal/jpmschweitzer/core-api (internal registry)
services:
core-api:
image: git.schweitz.internal/jpmschweitzer/core-api:latest
container_name: core-api
restart: unless-stopped
ports:
- "8083:8083"
environment:
# Application
- APP_NAME=Core API
- DEBUG=true
# Server
- HOST=0.0.0.0
- PORT=8083
# Logging
- LOG_LEVEL=INFO
# Ollama Configuration (AI Orchestration)
- OLLAMA_BASE_URL=http://ollama:11434
- OLLAMA_TIMEOUT=300
# Model Configuration
- DEFAULT_MODEL=gemma:7b
- LIGHTWEIGHT_MODELS=gemma:2b,gemma:7b
- HEAVY_MODELS=mistral:7b,gemma2:9b,mixtral:8x7b
- CODE_MODELS=codestral:latest,codegemma:latest
# Model Aliases (OpenAI → Local)
- ALIAS_GPT35=gemma:7b
- ALIAS_GPT4=mistral:7b
- ALIAS_GPT4_TURBO=mixtral:8x7b
- ALIAS_GPT4_CODE=codestral:latest
# Agent Configuration
# Set to "false" to make agent errors explicit (500 errors) instead of silent fallback.
- AGENT_FALLBACK_ENABLED=false
# Web Scraper settings
- WEB_SCRAPER_REQUEST_TIMEOUT=30
- WEB_SCRAPER_MAX_REDIRECTS=5
- WEB_SCRAPER_USER_AGENT=Mozilla/5.0 (compatible; CoreAPI/1.0)
- WEB_SCRAPER_DEFAULT_MAX_LENGTH=10000
- WEB_SCRAPER_MAX_LINKS_TO_EXTRACT=50
# Python path
- PYTHONPATH=/app
volumes:
# Data volumes only - no source code
- /home/jpmschweitzer/docker-data/core-api/logs:/app/logs
# Docker socket for direct container access (fallback when Portainer API incomplete)
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- docker-dataplane
deploy:
resources:
limits:
cpus: '2.0'
memory: 6G
reservations:
memory: 1G
labels:
- "com.centurylinklabs.watchtower.enable=true"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/health/full"]
interval: 30s
timeout: 20s
retries: 3
start_period: 60s
networks:
docker-dataplane:
external: true
name: docker-dataplane