- 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.
27 lines
1.1 KiB
YAML
27 lines
1.1 KiB
YAML
# An example for running Sonda with Docker Compose. Put the secret in a file named .env next to
|
|
# this one (it is not committed):
|
|
#
|
|
# SONDA_JWT_SECRET=<output of: openssl rand -hex 32>
|
|
# MUSIC_DIR=/path/to/your/music
|
|
# SONDA_PORT=8080 # optional, the port on this machine
|
|
#
|
|
# then: docker compose up -d --build
|
|
services:
|
|
sonda:
|
|
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:
|
|
- "127.0.0.1:${SONDA_PORT:-8080}:8080"
|
|
environment:
|
|
SONDA_JWT_SECRET: ${SONDA_JWT_SECRET:?set SONDA_JWT_SECRET in .env (openssl rand -hex 32)}
|
|
# TZ: Europe/Rome
|
|
volumes:
|
|
- sonda-data:/data # the database and the files Sonda makes: back up the database
|
|
- ${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:
|