You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.asciidoc
+134-2Lines changed: 134 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,13 +18,139 @@ Open http://localhost:8080. `rake dev` adds auto-reload. `rake help` lists all t
18
18
19
19
== Run with Podman
20
20
21
+
Images are published to link:https://quay.io/dkirwan/asset-monitoring[quay.io/dkirwan/asset-monitoring].
22
+
23
+
* `make podman-build` / `rake podman:build` tags a local build as `quay.io/dkirwan/asset-monitoring:dev`
24
+
* `make podman-run` / `rake podman:run` runs `quay.io/dkirwan/asset-monitoring:latest` (pulled from Quay if not present locally)
25
+
26
+
Run the published image:
27
+
28
+
```
29
+
make podman-run
30
+
```
31
+
32
+
Run a local dev build:
33
+
21
34
```
22
-
rake podman:build
23
-
rake podman:run
35
+
make podman-build
36
+
USE_DEV_IMAGE=true make podman-run
24
37
```
25
38
26
39
Binds `./data` → `/data` with SQLite for price and portfolio history (365-day retention by default). Override with `DATA_DIR`, `PRICE_HISTORY_RETENTION_DAYS`, `PRICE_HISTORY_DB_PATH`, `PORTFOLIO_DB_PATH`.
27
40
41
+
Override image tags:
42
+
43
+
```
44
+
BUILD_IMAGE=quay.io/dkirwan/asset-monitoring:dev make podman-build
45
+
IMAGE=quay.io/dkirwan/asset-monitoring:latest make podman-run
46
+
```
47
+
48
+
After building locally, push the dev image to Quay when you are ready to publish:
49
+
50
+
```
51
+
podman push quay.io/dkirwan/asset-monitoring:dev
52
+
```
53
+
54
+
== Running as a systemd service
55
+
56
+
Podman integrates with systemd through link:https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html[Quadlet].
57
+
A `.container` unit in `deploy/asset-monitoring.container` describes the service; systemd generates `asset-monitoring.service` from it at `daemon-reload` time.
58
+
59
+
This matches `rake podman:run` / `make podman-run`: the Quay `:latest` image, port `8080`, SQLite under `/data`, and 365-day price history retention.
60
+
61
+
Quadlet-generated units are *transient* — do not run `systemctl enable` on them (that fails with "Unit is transient or generated"). Boot wiring is handled by the `[Install]` section in the `.container` file when you run `daemon-reload`.
62
+
63
+
=== Requirements
64
+
65
+
* Podman with Quadlet support (Fedora 38+, RHEL 9+, or recent Podman elsewhere)
66
+
* systemd user session (for a rootless service) or root (for a system service)
67
+
68
+
=== Install (rootless, per user)
69
+
70
+
Create a data directory, pull the image, and install the Quadlet unit:
`daemon-reload` reads the `.container` file, generates the service unit, and applies the `[Install]` section (`WantedBy=default.target`) so the service starts on future user logins. Use `start` (not `enable`) to run it immediately.
83
+
84
+
Open http://localhost:8080/portfolio once the service is active.
85
+
86
+
The default unit stores SQLite data in `~/.local/share/asset-monitoring/data`. Edit the `Volume=` line in `~/.config/containers/systemd/asset-monitoring.container` before `daemon-reload` if you want a different path.
87
+
88
+
To keep the service running after you log out (and across reboots without a graphical login), enable linger:
The unit sets `io.containers.autoupdate=registry` so link:https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html[`podman auto-update`] can refresh the image on a schedule if you enable that separately.
151
+
152
+
To run a local `:dev` image instead, change `Image=` in the `.container` file to `quay.io/dkirwan/asset-monitoring:dev` (or your own tag), run `daemon-reload`, then restart the service.
153
+
28
154
== API
29
155
30
156
| Path | Purpose
@@ -50,6 +176,12 @@ Portfolio snapshots are recorded on save and after each successful scrape. Stock
0 commit comments