# 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} HANKAN_OPENAI_BASE_URL: ${HANKAN_OPENAI_BASE_URL:-} HANKAN_OPENAI_MODEL: ${HANKAN_OPENAI_MODEL:-} HANKAN_OPENAI_API_KEY: ${HANKAN_OPENAI_API_KEY:-} HANKAN_OPENAI_MAX_TOKENS: ${HANKAN_OPENAI_MAX_TOKENS:-} HANKAN_ALLOWED_ORIGINS: ${HANKAN_ALLOWED_ORIGINS:-*} PORT: 8787 networks: - hankan-net # Lets HANKAN_OPENAI_BASE_URL point at a model server running on the Pi # itself rather than in this compose file. Ignored if unused. extra_hosts: - "host.docker.internal:host-gateway" # 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}