78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
x-restart: &restart
|
|
restart: unless-stopped
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
<<: *restart
|
|
env_file: .env
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
ports:
|
|
- "127.0.0.1:${PORT_POSTGRES:-5432}:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
|
|
obsidian-headless:
|
|
container_name: beaver-obsidian
|
|
build:
|
|
context: .
|
|
dockerfile: obsidian.Dockerfile
|
|
<<: *restart
|
|
volumes:
|
|
- vault:/vault
|
|
- obsidian-config:/root/.config
|
|
working_dir: /vault
|
|
|
|
gateway:
|
|
container_name: beaver-gateway
|
|
build:
|
|
context: https://git.kotikot.com/beaver/beaver-gateway.git#${GATEWAY_REF:-main}
|
|
<<: *restart
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
env_file: .env
|
|
environment:
|
|
CONFIG_PATH: /config/config.py
|
|
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-beaver}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-beaver}
|
|
RAYCAST_CONFIG_PATH: /config/config.json
|
|
IS_SANDBOX: "1"
|
|
CLAUDE_PTY_SNAPSHOT_DIR: /tmp/cc-pty
|
|
ports:
|
|
- "${PORT_MESSAGES:-62990}:62990" # anthropic
|
|
- "${PORT_MCP:-62991}:62991" # mcp
|
|
- "${PORT_ADMIN:-62992}:62992" # admin
|
|
- "${PORT_MARKDOWN:-62993}:62993" # obsidian companion
|
|
volumes:
|
|
- ./config.py:/config/config.py:ro
|
|
- ./prompt.md:/config/prompt.md:ro
|
|
- ./config.json:/config/config.json:ro
|
|
- vault:/vault
|
|
- claude-home:/root/.claude
|
|
entrypoint:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
set -e
|
|
mkdir -p /root/.claude
|
|
if [ -f /root/.claude.json ] && [ ! -L /root/.claude.json ]; then
|
|
if [ ! -e /root/.claude/claude.json ]; then
|
|
mv /root/.claude.json /root/.claude/claude.json
|
|
else
|
|
rm /root/.claude.json
|
|
fi
|
|
fi
|
|
[ -e /root/.claude/claude.json ] || echo '{}' > /root/.claude/claude.json
|
|
ln -sf /root/.claude/claude.json /root/.claude.json
|
|
exec python -m beaver_gateway
|
|
|
|
volumes:
|
|
postgres-data:
|
|
vault:
|
|
obsidian-config:
|
|
claude-home:
|