All checks were successful
ci/woodpecker/push/build Pipeline was successful
brain-api now takes DATABASE_URL as a complete connection string from env instead of constructing it from POSTGRES_PASSWORD. This matches Portainer's env var pattern and avoids password duplication. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
2.0 KiB
YAML
66 lines
2.0 KiB
YAML
# OpenBrain — Portainer / Docker Swarm deployment
|
|
#
|
|
# Required environment variables (set in Portainer stack env):
|
|
# POSTGRES_PASSWORD — postgres superuser password (must match DATABASE_URL)
|
|
# DATABASE_URL — full postgres connection string
|
|
# API_KEY — secret key for API/MCP auth
|
|
# OLLAMA_URL — Ollama endpoint (e.g. http://10.x.x.x:11434)
|
|
# IMAGE_TAG — image tag to deploy (e.g. sha-abc1234 or latest)
|
|
#
|
|
# Optional:
|
|
# OLLAMA_EMBEDDING_MODEL — default: bge-m3:latest
|
|
# LOG_LEVEL — default: info
|
|
|
|
services:
|
|
brain-db:
|
|
image: pgvector/pgvector:pg17
|
|
environment:
|
|
POSTGRES_USER: openbrain
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: openbrain
|
|
volumes:
|
|
- brain_db_data:/var/lib/postgresql/data
|
|
- /opt/openbrain/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U openbrain -d openbrain"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- brain-internal
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: on-failure
|
|
|
|
brain-api:
|
|
image: git.mosaicstack.dev/mosaic/openbrain:${IMAGE_TAG:-latest}
|
|
environment:
|
|
DATABASE_URL: ${DATABASE_URL}
|
|
API_KEY: ${API_KEY}
|
|
OLLAMA_URL: ${OLLAMA_URL}
|
|
OLLAMA_EMBEDDING_MODEL: ${OLLAMA_EMBEDDING_MODEL:-bge-m3:latest}
|
|
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
networks:
|
|
- brain-internal
|
|
- traefik-public
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: on-failure
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.openbrain.rule=Host(`brain.woltje.com`)"
|
|
- "traefik.http.routers.openbrain.entrypoints=web"
|
|
- "traefik.http.services.openbrain.loadbalancer.server.port=8000"
|
|
- "traefik.docker.network=traefik-public"
|
|
|
|
volumes:
|
|
brain_db_data:
|
|
|
|
networks:
|
|
brain-internal:
|
|
driver: overlay
|
|
traefik-public:
|
|
external: true
|