fix(docker): keep the secret, quiet health checks, and tighter files

- The README keeps the JWT secret in a file that is passed every time, so an upgrade
  does not make a new one and sign everybody out.
- A health check that succeeds is logged at debug level, so a container does not write
  thousands of lines a day; any other answer, and every other request, still goes at info.
- .dockerignore patterns match in every folder, as .gitignore does.
- compose.yaml waits 15 seconds for Sonda to stop (it allows itself 10) and requires
  MUSIC_DIR instead of creating an empty folder.
- The README says that the library path is the one inside the container, that the health
  check follows SONDA_LISTEN, and that a sonda.toml in /data works as a secrets file.
This commit is contained in:
tgiachi 2026-11-12 12:29:38 +01:00
commit 95ba06311e

View file

@ -2,7 +2,7 @@
# this one (it is not committed):
#
# SONDA_JWT_SECRET=<output of: openssl rand -hex 32>
# MUSIC_DIR=/path/to/your/music # optional, ./music by default
# MUSIC_DIR=/path/to/your/music
# SONDA_PORT=8080 # optional, the port on this machine
#
# then: docker compose up -d --build
@ -11,6 +11,7 @@ services:
build: .
image: sonda:local
restart: unless-stopped
stop_grace_period: 15s # Sonda waits up to 10 seconds for the requests in progress when it is stopped
# Only this machine can reach it. To serve your network, publish "${SONDA_PORT:-8080}:8080" instead,
# and put a reverse proxy with https in front of it.
ports:
@ -20,7 +21,7 @@ services:
# TZ: Europe/Rome
volumes:
- sonda-data:/data # the database and the files Sonda makes: back up the database
- ${MUSIC_DIR:-./music}:/music:ro # your music, read-only: a library is added with the path /music
- ${MUSIC_DIR:?set MUSIC_DIR in .env to the folder of your music}:/music:ro # your music, read-only: a library is added with the path /music
volumes:
sonda-data: