navidrome / navidrome

🎧☁️ Modern Music Server and Streamer compatible with Subsonic/Airsonic
https://www.navidrome.org
GNU General Public License v3.0
10.17k stars 783 forks source link

[Bug]: Data reset after docker-compose restart! #2965

Closed gangstareloading closed 3 weeks ago

gangstareloading commented 3 weeks ago

I confirm that:

Version

v0.51.1

Current Behavior

restarting the navidrome docker container causes all data to be lost. songs get rescanned all users deleted

Expected Behavior

restarting should keep all users data. songs may get rescanned users accounts should stay

Steps To Reproduce

  1. create a docker-compose file with the service:
 image: (image_id)
 ports:
     - "4533:4533"
 volumes:
     - "/home/music/Music/some_music:/music"
  1. run it and create some accounts and listen to some music
  2. restart it (docker-compose restart)
  3. everything's gone :(

Environment

- OS:Ubuntu 20.04 latest
- Browser: Firefox
- Client: same OS & broweser.

How Navidrome is installed?

Docker

Configuration

version: '3.9'
services:
navidrome_service:
 image: (image_id)
 ports:
     - "4533:4533"
 volumes:
     - "/home/music/Music/some_music:/music"

Anything else?

everything at the /data folder (outside the container) got deleted.

Code of Conduct

deluan commented 3 weeks ago

You need to map a volume for your data folder, or else it will be a ephemeral space inside the container. Ex:

    volumes:
      - "/home/music/Music/some_music:/music"
      - "/path/to/data:/data"

See https://www.navidrome.org/docs/installation/docker/ for more info on using Navidrome with Docker.