diff --git a/.gitignore b/.gitignore index f3c65db..33edfb2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,9 @@ dist/ ._* github_token /nom + +# local dev/docker artifacts referenced in README docs +config.yml +my-nom-config.yml +nom.db +nom-data/ diff --git a/README.md b/README.md index fbca5ff..52ccce2 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,14 @@ And you cannot combine simple keyword searches with any qualifiers: ## Building and Running via Docker +> **Windows (Git Bash):** Git Bash rewrites `/app/...` paths in `-v` flags as if they were local Windows paths, which breaks volume mounts. Prefix `docker run` commands with `MSYS_NO_PATHCONV=1` to disable this, e.g.: +> ```sh +> MSYS_NO_PATHCONV=1 docker run --rm -it \ +> -v "$(pwd)/my-nom-config.yml":/app/docker-config.yml \ +> -v "$(pwd)/nom-data":/data \ +> ghcr.io/guyfedwards/nom:master +> ``` + Build nom image ```sh @@ -299,6 +307,25 @@ Available tags: - `x.y.z` / `x.y` - pinned release versions (e.g. `3.0.0`) - `sha-` - exact commit builds +### Persisting the database + +The container has no `XDG_CONFIG_HOME`, so nom resolves the sqlite file relative to its working directory by default. To persist read state and cached articles across container restarts, mount a directory and point `database` at an absolute path inside it in your config: + +```yaml +# my-nom-config.yml +database: /data/nom.db +``` + +```sh +mkdir -p nom-data +docker run --rm -it \ + -v $PWD/my-nom-config.yml:/app/docker-config.yml \ + -v $PWD/nom-data:/data \ + ghcr.io/guyfedwards/nom:master +``` + +Don't `touch` the db file yourself and bind-mount it directly - nom only runs its initial table setup when the file doesn't exist yet, so a pre-created empty file leaves the database schemaless. + ## Dev setup You can use `backends-compose.yml` to spin up a local instance of [MiniFlux] and [FreshRSS] if needed for development.