Closed necrosmash closed 3 months ago
The Dockerfile is creating an anonymous volume so things should be persistent. However, the docker compose down
docs say that a subsequent up will not remount anonymous volumes:
Anonymous volumes are not removed by default. However, as they don’t have a stable name, they are not automatically mounted by a subsequent up. For data that needs to persist between updates, use explicit paths as bind mounts or named volumes.
It seems that docker compose stop
works though, you can use that command instead.
Mounting /commafeed/data
also works, I'm not sure why it doesn't for you. I adapted the instructions on https://hub.docker.com/r/athou/commafeed since it makes more sense to map that volume to the host. That way it also matches the instructions for postgresql.
I was mounting commafeed
to another dir called commafeed
at the same level as my docker compose file. This volume did end up with a data
directory within the commafeed
directory, as I expected, but no db file. It might have been something screwy with that, or permissions, or some combination of those.
Regardless I have tried the following, successfully, with docker compose up
, then docker compose down
, then finally docker compose up
again:
services:
commafeed:
image: athou/commafeed:latest
restart: unless-stopped
volumes:
- ./data:/commafeed/data
deploy:
resources:
limits:
memory: 256M
ports:
- 8082:8082
so the problem was on my end. Sorry!
Describe the bug I lose my data every time I restart the container.
To Reproduce
docker-compose
file from https://hub.docker.com/r/athou/commafeeddocker compose up
docker compose down
docker compose up
Expected behavior The data should persist after restarting the container
Screenshots
Environment (please complete the following information):
f52064e21863
Additional context I notice there are no volumes, could this be why it's happening? I tried manually adding my own volume entry to
commafeed/data
but the db file isn't written to it, unsure why, might be a rights issue. But regardless, I can't tell how persistence if meant to happen, if at all. I'm following the example docker compose file at https://hub.docker.com/r/athou/commafeed, as I mentioned above.If this is expected behaviour, it might be good to specify this.