Files
parentcalendar/deploy/compose-complete.yml
T

79 lines
3.5 KiB
YAML

# ParentCalendar and Ollama in one Compose project, with every setting from .env.example.
# Copy this file to an empty folder as compose.yml, next to a copy of .env.example named .env (Compose fills
# each ${VAR:-default} below from that .env; leave a line out of .env to get the default). Then:
# docker compose up -d
# docker compose exec ollama ollama pull nemotron-3.5-bolt:e4b # once, and again when you change EXTRACT_MODEL
# On Linux, `mkdir data && sudo chown 1000 data` first: the app's container runs as uid 1000.
services:
parentcalendar:
image: git.dou.bet/iamdoubz/parentcalendar:latest # or pin a release, e.g. :0.0.7
container_name: parentcalendar
mem_limit: 512M
restart: unless-stopped
depends_on:
- ollama
environment:
# Base URL the app is reached at; its domain goes into new event UIDs.
- PUBLIC_URL=${PUBLIC_URL:-https://calendar.example.com}
# Fixed for this setup, so a .env made for running without Docker can't break them.
- DATA_DIR=/data
- HOST=0.0.0.0
- OLLAMA_URL=http://ollama:11434
- PORT=${PORT:-8000}
# Extraction model: an Ollama model, or a claude-* model (then set ANTHROPIC_API_KEY).
- EXTRACT_MODEL=${EXTRACT_MODEL:-nemotron-3.5-bolt:e4b}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
# Ollama settings. Empty top P and top K use the model's own.
- EXTRACT_TEMPERATURE=${EXTRACT_TEMPERATURE:-0}
- EXTRACT_TOP_P=${EXTRACT_TOP_P:-}
- EXTRACT_TOP_K=${EXTRACT_TOP_K:-}
- EXTRACT_NUM_CTX=${EXTRACT_NUM_CTX:-16384}
- EXTRACT_KEEP_ALIVE=${EXTRACT_KEEP_ALIVE:-10m}
- EXTRACT_THINK=${EXTRACT_THINK:-0}
- EXTRACT_THINK_LEVEL=${EXTRACT_THINK_LEVEL:-}
# Only for the command-line eval; in the app each source's "double read" setting decides.
- EXTRACT_DOUBLE_READ=${EXTRACT_DOUBLE_READ:-0}
# Comma-separated labels that are never food or events, e.g. BHS.
- EXTRACT_IGNORE=${EXTRACT_IGNORE:-}
# National days in Settings > Holidays: a free key from https://marketplace.apilayer.com/checkiday-api
- CHECKIDAY_API_KEY=${CHECKIDAY_API_KEY:-}
# Days to keep photos after a scan is published.
- IMAGE_RETENTION_DAYS=${IMAGE_RETENTION_DAYS:-90}
# 1 adds a "Scan Stats" button to each scan's page.
- SHOW_SCAN_STATS=${SHOW_SCAN_STATS:-0}
# Only this machine can reach it; put nginx (HTTPS) in front, see nginx.conf in this folder.
ports:
- "127.0.0.1:${PORT:-8000}:${PORT:-8000}"
volumes:
- ./data:/data # must be a local disk, not a network share
ollama:
image: ollama/ollama:latest # AMD: ollama/ollama:rocm
container_name: parentcalendar-ollama
mem_limit: 8G
restart: unless-stopped
# No ports: the app reaches it as http://ollama:11434 on the Compose network.
# Add "127.0.0.1:11434:11434" here to use it from this machine too (the phase0 eval).
volumes:
- ollama:/root/.ollama # downloaded models
# NVIDIA: needs the NVIDIA Container Toolkit on the host.
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
# AMD: use the rocm image above, delete the deploy block, and uncomment these.
# devices:
# - /dev/kfd
# - /dev/dri
# If Ollama can't see the GPU, add the numeric group IDs of /dev/kfd and /dev/dri/* from
# `ls -lnd /dev/kfd /dev/dri/*` on the host (often video and render):
# group_add:
# - "44"
# - "993"
volumes:
ollama: