Add Docker image workflow for ani-cli-web
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
A local web UI for a system-wide `ani-cli` install.
|
||||
|
||||
Current version: `0.29.5`
|
||||
Current version: `0.30.0`
|
||||
|
||||
## Project Layout
|
||||
|
||||
@@ -10,11 +10,13 @@ Current version: `0.29.5`
|
||||
ani-cli-web/
|
||||
app.py Public entrypoint, runtime wiring, watchlist domain logic, and CLI startup.
|
||||
app_support.py Shared runtime/state/config helpers plus queue and library file utilities.
|
||||
Dockerfile Container image build for system-wide ani-cli plus /app ani-cli-web.
|
||||
queue_jobs.py Download queue and background watchlist-refresh workers.
|
||||
watchlist_identity.py Safer watchlist identity resolution for queued download jobs.
|
||||
title_matching.py Shared anime-title normalization and matching helpers.
|
||||
http_handler.py HTTP route handling, request parsing, and remote-access guard.
|
||||
web_templates.py Shared Search, Config, and Watchlist page markup aggregation.
|
||||
docker-entrypoint.sh Container startup wrapper with optional ani-cli self-update.
|
||||
search_page.py Search page template.
|
||||
config_page.py Config page template.
|
||||
watchlist_page.py Watchlist page template.
|
||||
@@ -50,6 +52,56 @@ http://127.0.0.1:8421/
|
||||
|
||||
By default the server binds to `127.0.0.1:8421`.
|
||||
|
||||
## Docker
|
||||
|
||||
The container image installs `ani-cli` system-wide and clones `ani-cli-web` into `/app` during `docker build`.
|
||||
|
||||
Default build arguments:
|
||||
|
||||
```text
|
||||
ANI_CLI=https://github.com/pystardust/ani-cli.git
|
||||
ANI_CLI_BRANCH=master
|
||||
ANI_CLI_WEB=https://gitea.coreplay.eu/Dymas/ani-cli-web.git
|
||||
```
|
||||
|
||||
Build the image:
|
||||
|
||||
```sh
|
||||
docker build -t ani-cli-web .
|
||||
```
|
||||
|
||||
Override the `ani-cli` branch when needed:
|
||||
|
||||
```sh
|
||||
docker build \
|
||||
--build-arg ANI_CLI_BRANCH=my-feature-branch \
|
||||
--build-arg ANI_CLI=https://github.com/pystardust/ani-cli.git \
|
||||
--build-arg ANI_CLI_WEB=https://gitea.coreplay.eu/Dymas/ani-cli-web.git \
|
||||
-t ani-cli-web .
|
||||
```
|
||||
|
||||
Run the container with the requested persistent mounts:
|
||||
|
||||
```sh
|
||||
docker run --rm \
|
||||
-p 8421:8421 \
|
||||
-e UPDATE_ON_START=true \
|
||||
-v "$(pwd)/downloads:/downloads" \
|
||||
-v "$(pwd)/.ani-cli-web:/app/.ani-cli-web" \
|
||||
ani-cli-web
|
||||
```
|
||||
|
||||
Container defaults:
|
||||
|
||||
- `ani-cli` is installed at `/usr/local/bin/ani-cli`.
|
||||
- `ani-cli-web` is cloned into `/app` and started from there.
|
||||
- Downloads are written to `/downloads`, so bind-mount `./downloads:/downloads`.
|
||||
- App state stays under `/app/.ani-cli-web`, so bind-mount `./.ani-cli-web:/app/.ani-cli-web`.
|
||||
- The image sets `ANI_CLI_WEB_HOST=0.0.0.0` and exposes port `8421`.
|
||||
- `UPDATE_ON_START=true` runs `sudo ani-cli --update` before the web app starts.
|
||||
|
||||
The installed `ani-cli` update URL is rewritten during the image build so `ani-cli --update` follows the same `ANI_CLI_BRANCH` you built into the image when the `ANI_CLI` remote is a GitHub repository.
|
||||
|
||||
## Overview
|
||||
|
||||
`ani-cli-web` keeps search and download management on `/`, saved defaults on `/config`, and the watchlist on `/watchlist`, all with the same sidebar navigation layout and a Tsuki-inspired visual style.
|
||||
@@ -292,6 +344,7 @@ Environment variables:
|
||||
- `ANI_CLI_WEB_REMOTE_TOKEN`: required shared secret for non-loopback clients when remote access is enabled.
|
||||
- `ANI_CLI_WEB_DEBUG`: enable debug logging when set to `1`, `true`, `yes`, or `on`.
|
||||
- `ANI_CLI_WEB_STATE_ROOT`: override the project-local state directory path; useful for isolated test runs or custom storage locations.
|
||||
- `UPDATE_ON_START`: when set to `1`, `true`, `yes`, or `on` in the container, runs `sudo ani-cli --update` before `ani-cli-web` starts.
|
||||
|
||||
Saved defaults from the UI are written into the project-local `config.json`.
|
||||
|
||||
@@ -303,4 +356,5 @@ Saved defaults from the UI are written into the project-local `config.json`.
|
||||
- The CLI startup path itself also stays lazy now; runtime bootstrap happens when the first runtime-backed request arrives.
|
||||
- Watchlist and queue data are stored in the same project-local SQLite database file, `state.sqlite3`.
|
||||
- Runtime folders such as `.ani-cli-web/`, `downloads/`, and Python bytecode cache directories at any depth are ignored by git.
|
||||
- The Docker image clones both upstream repositories during build, so the app source inside the container comes from the configured git remotes rather than the local build context.
|
||||
- Focused regression tests live in `test_app.py`, run against an isolated temporary state root, and can be started with `python3 -m unittest test_app.py`.
|
||||
|
||||
Reference in New Issue
Block a user