Athou / commafeed

Google Reader inspired self-hosted personal RSS reader.
https://www.commafeed.com
Apache License 2.0
2.81k stars 377 forks source link

running commafeed via docker compose persists no data #1498

Closed necrosmash closed 3 months ago

necrosmash commented 3 months ago

Describe the bug I lose my data every time I restart the container.

To Reproduce

Expected behavior The data should persist after restarting the container

Screenshots image

Environment (please complete the following information):

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.

Athou commented 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.

necrosmash commented 3 months ago

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!