write/docker-compose.yml
chris 0cae6c6188 Fix AI prompts: switch to OpenAI-compatible /v1/chat/completions API
The server at ai.binarygnome.com returns 405 on POST /api/generate,
which means it speaks the OpenAI-compatible API rather than the native
Ollama format. Switch to /v1/chat/completions with messages[] payload
and data.choices[0].message.content response parsing.

Also add optional OLLAMA_API_KEY env var for servers that require a
Bearer token.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 20:27:31 -04:00

43 lines
1.0 KiB
YAML

services:
server:
build: ./server
restart: unless-stopped
volumes:
- ./server_data:/app/data
- ./server_uploads:/app/uploads
environment:
- JWT_SECRET=${JWT_SECRET:-change-me-in-production}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- OLLAMA_URL=${OLLAMA_URL:-https://ai.binarygnome.com}
- OLLAMA_MODEL=${OLLAMA_MODEL:-gemma4:latest}
- OLLAMA_API_KEY=${OLLAMA_API_KEY:-}
extra_hosts:
- "host-gateway:host-gateway"
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "node -e \"require('net').createConnection(3000).on('connect',()=>process.exit(0)).on('error',()=>process.exit(1))\""]
interval: 5s
timeout: 3s
retries: 10
start_period: 15s
app:
build: ./frontend
restart: unless-stopped
depends_on:
server:
condition: service_healthy
networks:
- internal
ports:
- "127.0.0.1:3080:80"
networks:
internal:
driver: bridge
volumes:
server_data:
server_uploads: