Skip to content

Add Docker support for headless deployment#522

Open
deviationist wants to merge 3 commits into
Marekkon5:masterfrom
deviationist:pr/docker-support
Open

Add Docker support for headless deployment#522
deviationist wants to merge 3 commits into
Marekkon5:masterfrom
deviationist:pr/docker-support

Conversation

@deviationist

Copy link
Copy Markdown

Adds an optional containerised build of onetagger-cli for users running 1T headlessly behind a reverse proxy. Addresses the Docker / no-GTK build mode discussed in #314 and #25.

This is purely additive — no changes to existing build or runtime behaviour, no new runtime dependencies for desktop users. The image builds onetagger-cli only (no onetagger GUI crate), so it skips the webkit2gtk dependency you mentioned in #314 as the source of Docker image bloat.

What's included

  • Dockerfile — multi-stage: rust:1-bookworm builds the pnpm client and cargo build --release -p onetagger-cli; debian:bookworm-slim runtime ships only libasound2, libssl3, ca-certificates
  • docker-compose.yml — starter compose with a ./music volume and inline comments showing the rw-staging / ro-main pattern
  • .dockerignore
  • README section covering build, run, options, and reverse-proxy setup

Security posture

Container binds 0.0.0.0:36913 internally (so the reverse proxy can reach it); compose publishes to 127.0.0.1:36913 only. Hardened with read_only, cap_drop: ALL, no-new-privileges. The README is explicit that 1T is insecure by design and the container must sit behind an authenticating reverse proxy, matching the guidance you gave in #314 and #111.

Maintenance

Files are static and version-pinned (rust:1-bookworm, debian:bookworm-slim). No CI image publishing — users build locally. No changes to onetagger-cli source.

Pairs with #521 (auto-selects wss:// when behind an HTTPS proxy).

Test plan

  • docker compose build succeeds from a clean checkout
  • docker compose up starts the container on 127.0.0.1:36913
  • UI loads at http://127.0.0.1:36913 and the embedded websocket connects
  • Same image behind an HTTPS reverse proxy — UI loads and wss:// connects (with Use wss:// when client is served over HTTPS #521)
  • Desktop GUI build (cargo build without -p onetagger-cli) is unaffected

deviationist and others added 3 commits May 15, 2026 07:48
Multi-stage build: rust:1-bookworm compiles client (pnpm) and
onetagger-cli only (no webkit/gtk deps), debian:bookworm-slim runtime
ships libasound2, libssl3, ca-certificates. Container binds
0.0.0.0:36913 with --expose; compose maps 127.0.0.1:36913 for an
external reverse proxy. Mounts mirror the host ReadWritePaths policy
(/mnt/music/on-hold rw, /mnt/music/main ro). Hardened with read_only,
cap_drop ALL, no-new-privileges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a Docker section after Installing covering build (compose and
docker build), run (compose and docker run), and an options reference
for port, volumes, user, CLI flags, hardening, and reverse-proxy setup.
Describes the ws/wss auto-detection introduced in 4f7d0ca so users
know the same image works behind both HTTP and HTTPS proxies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces deployment-specific volume paths with ./music as a starter
mount and adds an inline example of the rw-staging / ro-main pattern
as a comment. Replaces references to a specific reverse proxy stack
with neutral guidance. Image tag drops the -local suffix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@deviationist

Copy link
Copy Markdown
Author

@Marekkon5 If you have time and possibility, and you agree with the addition of a Dockerfile and the contents of it, would you consider merging this into main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant