- BIND_ADDR (default 0.0.0.0) on every published port; 127.0.0.1 keeps the stack reachable from the host only (Docker bypasses ufw, so this is the actual control the kiosk addon's 'this kiosk only' choice uses) - Koha serves its web-installer page with HTTP 200 before the database exists, so 'port answers' was not 'ready': the entrypoint now writes /run/koha-ready, the healthcheck requires it, and install.sh waits for healthy + the quick-add health endpoint Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013wi3ZSot4XbUViwRFgLpRf
74 lines
2.0 KiB
YAML
74 lines
2.0 KiB
YAML
name: library
|
|
|
|
services:
|
|
db:
|
|
image: mariadb:10.11
|
|
container_name: library-db
|
|
restart: unless-stopped
|
|
environment:
|
|
MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
|
MARIADB_DATABASE: koha_library
|
|
MARIADB_USER: koha_library
|
|
MARIADB_PASSWORD: ${DB_PASSWORD}
|
|
command: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--innodb-buffer-pool-size=128M"]
|
|
volumes:
|
|
- db-data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
koha:
|
|
build:
|
|
context: ./koha
|
|
args:
|
|
KOHA_SUITE: ${KOHA_SUITE:-stable}
|
|
image: library-koha:local
|
|
container_name: library-koha
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
TZ: ${TZ:-UTC}
|
|
KOHA_DB_HOST: db
|
|
KOHA_DB_PASS: ${DB_PASSWORD}
|
|
KOHA_ADMIN_USER: ${ADMIN_USER:-admin}
|
|
KOHA_ADMIN_PASS: ${ADMIN_PASSWORD}
|
|
KOHA_LIBRARY_NAME: ${LIBRARY_NAME:-My Library}
|
|
ports:
|
|
- "${BIND_ADDR:-0.0.0.0}:${OPAC_PORT:-8080}:80"
|
|
- "${BIND_ADDR:-0.0.0.0}:${STAFF_PORT:-8081}:8081"
|
|
volumes:
|
|
- koha-data:/var/lib/koha
|
|
|
|
# Scan an ISBN -> the book is added (Z39.50 lookup, then Koha's REST API).
|
|
quickadd:
|
|
build:
|
|
context: ./quickadd
|
|
image: library-quickadd:local
|
|
container_name: library-quickadd
|
|
restart: unless-stopped
|
|
depends_on:
|
|
koha:
|
|
condition: service_started
|
|
environment:
|
|
TZ: ${TZ:-UTC}
|
|
KOHA_API: http://koha:8081/api/v1
|
|
ADMIN_USER: ${ADMIN_USER:-admin}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
|
|
KOHA_LIBRARY: HOME
|
|
OPAC_PORT: ${OPAC_PORT:-8080}
|
|
STAFF_PORT: ${STAFF_PORT:-8081}
|
|
QUICKADD_SOURCES: ${QUICKADD_SOURCES:-z3950:lx2.loc.gov:210/LCDB,openlibrary}
|
|
ports:
|
|
- "${BIND_ADDR:-0.0.0.0}:${QUICKADD_PORT:-8082}:8082"
|
|
volumes:
|
|
- quickadd-data:/data
|
|
|
|
volumes:
|
|
db-data:
|
|
koha-data:
|
|
quickadd-data:
|