MyKindlebox/mykindlebox/docker-compose.yml

44 lines
1.6 KiB
YAML

services:
server:
build: ./server
environment:
# Auth is account-based (users live in the database): the first visit
# shows a one-time account-creation screen, and more users are added in
# Settings. The old MYKINDLEBOX_PASSWORD/AUTH_PASSWORD env var is no
# longer used.
DATA_DIR: /app/data
# Pedigree scanning (Add Rabbit → "Scan a pedigree") sends the photo to
# the Claude API. Set ANTHROPIC_API_KEY in .env to enable it; without it
# the scan button is hidden and everything else works as before.
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
volumes:
- server-data:/app/data
restart: unless-stopped
# busybox wget ships in node:20-alpine, so no extra package is needed.
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3001/health"]
interval: 30s
timeout: 3s
start_period: 15s
retries: 3
# No published port: the server is only reached through the client's nginx
# reverse proxy on the internal compose network. Add a `ports` mapping here
# if you want to hit the API directly for debugging.
client:
build: ./client
ports:
# Host port is configurable: set MYKINDLEBOX_PORT (e.g. in .env) to serve
# on a different port. Defaults to 8080.
- "${MYKINDLEBOX_PORT:-8080}:80"
# Wait for the API to answer /health before starting nginx, so the first
# page load after `docker compose up` can't hit a 502 from a still-booting
# server.
depends_on:
server:
condition: service_healthy
restart: unless-stopped
volumes:
server-data: