compose.yaml joins the Pi's existing network as external and reaches the Postgres and Caddy already there by name; nothing is published to the host. The schema applies itself on boot, so there is no migration step to run by hand. The Caddy snippet in the README is the part worth reading. Excluding /api/tutor from `encode` matters more than flush_interval: compression delays the header flush until body bytes arrive and holds already-flushed events inside an unfinished frame, which presents as a stream that hangs rather than as an error. Untested against the actual Pi — written from PORT.md and verified only as far as building the image and running it against a local Postgres. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
# Hankan's server, joining the Postgres and Caddy already running on the Pi.
|
|
#
|
|
# It brings up no database of its own: `hankan-net` is declared external, so
|
|
# this file attaches to the network those services are already on rather
|
|
# than standing up a parallel stack. Set the network name to whatever your
|
|
# existing compose project created — `docker network ls` will show it.
|
|
#
|
|
# cp .env.example .env # then fill it in
|
|
# docker compose up -d
|
|
|
|
services:
|
|
hankan:
|
|
build:
|
|
context: ..
|
|
dockerfile: server/Dockerfile
|
|
container_name: hankan
|
|
restart: unless-stopped
|
|
environment:
|
|
# Reaches the existing Postgres by service name on the shared network.
|
|
DATABASE_URL: ${DATABASE_URL}
|
|
HANKAN_TOKEN: ${HANKAN_TOKEN}
|
|
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
|
|
HANKAN_TUTOR_BACKEND: ${HANKAN_TUTOR_BACKEND:-anthropic}
|
|
PORT: 8787
|
|
networks:
|
|
- hankan-net
|
|
# No ports published: Caddy is on the same network and proxies to
|
|
# hankan:8787 by name, so the service is never exposed directly.
|
|
|
|
networks:
|
|
hankan-net:
|
|
external: true
|
|
name: ${HANKAN_NETWORK:-caddy_default}
|