Media Server, Pt 1 - Navidrome
Having set up our stack for swarm deployment, and deployed a blog server to demonstrate, I'm going to turn to deploying various media servers. The first is Navidrome, a music server. It's pretty much self-contained, so this will be quick.
$ mkdir -p /srv/data/shared/media/music
$ mkdir -p /srv/data/docker/navidrome/data
$ sudo chown -R 10002:10002 /srv/data/docker/navidrome
$ sudo chmod -R g-rwx,o-rwx /srv/data/docker/navidrome
$ sudo chgrp -R 10002 /srv/data/shared/media
Most notable, we create a shared directory that will, eventually, hold our media files. It will be owned by a shared group, and be made, again, eventually, group writeable once we deploy services that need to write there. Navidrome just needs read access.
Add the following to your compose file.
navidrome:
deploy:
labels:
traefik.enable: "true"
traefik.http.routers.navidrome-rtr.entrypoint: websecure
traefik.http.routers.navidrome-rtr.rule: "Host(`media.<your domain>`)"
traefik.http.routers.navidrome-rtr.service: "navidrome"
traefik.http.services.navidrome.loadbalancer.server.port: "4533"
replicas: 1
environment:
ND_BASEURL: "https://media.<your domain>"
ND_ENABLEEXTERNALSERVICES: "false"
image: "deluan/navidrome:latest"
logging:
driver: journald
networks:
- homelab
restart: unless-stopped
user: "10002:10002"
volumes:
- "/srv/data/docker/navidrome/data:/data"
- "/srv/data/shared/media/music:/music:ro"
Navidrome is configured via environment variables. Feel free to tweak the configuration, but be aware that if you enable outside integrations, you will need to move the container to the network "homelab-bridged" for it to have internet access. The service is run as user and group ID 10001. And that's really it, other than copying your music library to /srv/data/shared/media/music. Navidrome will be accessible under https://media.<your domain>.
This is probably an opportune time to remind you to subsecibe and support the starving admin writing this.