Data is not persisted: after container recreate the database is empty.
IntermediateTroubleshootingStorage, volumes and disk space
Answer
Likely causes → Wrong mount path, anonymous volume created (image's VOLUME) so a new one appears each time, or Compose project name changed so the volume name differs.
Diagnose →
docker inspect -f '{{json .Mounts}}' db
docker volume ls
Fix → Mount a named volume at the exact data directory, reuse the same project/volume name (name: in compose volume).
Prevent → Explicit named volumes with fixed name:.
More on Storage, volumes and disk space
`no space left on device` while pulling an image or starting a container.Beginner`df` shows free space but Docker says no space: inodes at 100%.Advanced`/var/lib/docker/containers/<id>/<id>-json.log` is 50 GB.Beginner`docker system prune` did not free much although `docker system df` shows large "Reclaimable".IntermediateVolume data disappeared after `docker compose down -v` or `docker volume prune`.Intermediate`docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist`Beginner