Commit Graph
43 Commits
Author SHA1 Message Date
Donkie 59672ecb30 Merge master into feature/v2-client
Brings the branch up to 0.25.0 and picks up cosign image signing, the
armv7/arm64 smoke tests, the armv7 greenlet/libstdc++ fix, the
PUID/PGID and Kubernetes SPOOLMAN_PORT entrypoint guards, and the
externaldb unwritable-path fix.

The only conflict was publish-images' needs list, where both sides had
added a job: test-frontend-v2 here, test-multiarch-smoke on master.
Resolved as the union, so nothing publishes until every test job has
passed. The rest of the graph is unchanged, and the new smoke tests
inherit client_v2 coverage for free -- build-arm64 and build-armv7
already download the client_v2 artifact, so booting those images to
/health now also proves the default client is present in them.

Claude-Session: https://claude.ai/code/session_01UB5KocsTBm9GL5x3Uuup5F
2026-07-30 21:02:14 +02:00
Aleksei Sviridkin 129650237a fix(docker): link libstdc++ into the armv7 greenlet extension (#971)
greenlet ships no 32-bit ARM wheel, so on armv7 it is compiled from source.
setuptools links the C++ extension with gcc, which leaves libstdc++ out of the
.so's NEEDED list. The extension then fails to import with an undefined
libstdc++ typeinfo symbol (_ZTVN10__cxxabiv120__si_class_type_infoE), which
takes the whole app down during the startup DB migration -- the container
crashloops on any armv7 host such as a 32-bit Raspberry Pi.

Add libstdc++ to the extension's NEEDED list with patchelf so the dynamic
loader pulls it in. amd64 and arm64 use a correctly linked prebuilt wheel and
are untouched.

Verified by patching the shipped 0.24.0 armv7 image's greenlet .so the same
way: `alembic upgrade head` then runs to completion instead of crashing.

Assisted-By: Claude <noreply@anthropic.com>

Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-07-22 15:55:33 +02:00
Donkie 638466bc70 Bake client_v2 into the image and serve it by default
Build the new Svelte client (client_v2) in CI, bake it into the Docker
image alongside the legacy React client, and serve it by default. Set
SPOOLMAN_LEGACY_CLIENT=TRUE to fall back to the old client.

SinglePageApplication is generalized to serve either client: the React
client keeps its index.html + base-path rewriting, while the Svelte
client uses a 200.html SPA fallback, serves prerendered per-route pages,
and serves relative-path assets verbatim. The tweaked-HTML store is moved
off self.html, which StaticFiles uses as its HTML-mode flag.

The Playwright frontend suite targets the React DOM, so it's pinned to
the legacy client via SPOOLMAN_LEGACY_CLIENT for now.

Claude-Session: https://claude.ai/code/session_01VQQtwPBPiMCoZCpBbbqS64
2026-07-18 23:05:00 +02:00
Donkie 3a3273d9a9 Merge PR #798 (current head): tidy unprivileged Docker support
Brings in the latest #798 commit (388082f) that our earlier merge missed: it
drops --chown from the builder COPYs (matching the Podman build fix already on
master), removes the redundant `usermod -G users app`, and simplifies the
entrypoint to re-exec itself via gosu when root instead of duplicating the
uvicorn invocation. Dockerfile comment conflict resolved in favour of the
Podman-explaining comment.
2026-07-06 15:22:03 +02:00
Donkie c81920d23c Merge PR #798: conditional permission drop for unprivileged Docker
Brings in jpiccari's unprivileged-Docker support (rootless entrypoint that only
uses gosu when running as root and only remaps app UID/GID when they differ, plus
dropping the redundant `groupmod -g 1000 users` in the runner stage).

Combines cleanly with the Podman build/test enablement already on master
(builder-stage --chown removal, postgres healthcheck, run.py engine selection),
giving full rootless build + run + test support.
2026-07-06 15:14:49 +02:00
Donkie e3c5f3fc1d Make the integration test suite runnable under Podman
Running tests_integration against rootless Podman surfaced three issues; none
affect the Docker/CI path:

- run.py: add a SPOOLMAN_CONTAINER_ENGINE env var (defaults to "docker") so the
  build/compose commands can be driven by podman instead.
- Dockerfile: drop `--chown=app:app` from the builder-stage COPYs. The "app"
  user only exists in the runner stage; Docker/BuildKit tolerated the dangling
  reference but Podman rejects it. Final ownership is unchanged — it is set when
  the files are copied into the runner stage.
- docker-compose-postgres.yml: add a pg_isready healthcheck and gate spoolman on
  `condition: service_healthy`, matching the mariadb/cockroachdb compose files.
  Without it spoolman raced postgres' initdb and died on connection-refused
  before running migrations.

Verified: full 4-DB suite (sqlite/postgres/mariadb/cockroachdb) green via
`SPOOLMAN_CONTAINER_ENGINE=podman uv run poe itest` — 223 tests each.
2026-07-06 12:16:17 +02:00
Joshua Piccari 388082f27a Tidy up docker file and entrypoint 2026-04-26 14:29:48 -07:00
Joshua Piccari 137558639a Add conditional logic to drop permissions for unprivileged Docker
This change enables the container to run in unprivileged mode (without
--privileged or additional capabilities) by making permission drops
conditional:

- Changed users group GID from 1000 to 1001 to avoid conflicts with
  the app user's primary group (UID 1000)
- Only modify user/group IDs when PUID/PGID environment variables differ
  from the default value of 1000, avoiding unnecessary privilege
  requirements
- Skip su-exec entirely when running as the default user, since changing
  user context requires additional capabilities that unprivileged
  containers don't have

This allows the container to work in restricted environments like
Kubernetes with security contexts or rootless Docker while maintaining
backward compatibility for users who customize PUID/PGID.

Fixes Donkie#791
2026-02-28 10:43:50 -08:00
Donkie dd0476ced3 Don't use uv specific image in dockerfile, it doesn't support armv7 2026-01-20 22:11:46 +01:00
Donkie b942d1f8a1 Replaced pdm with uv, updated backend deps, python 3.10 minimum, simplified install script 2026-01-07 22:01:02 +01:00
Donkie 753140ecc3 Replaced su-exec with gosu, fixed pdm using wrong python version 2026-01-05 23:53:41 +01:00
Philip Mayer 9df3f0c91b Add changes based on code review https://github.com/Donkie/Spoolman/issues/745 2025-09-22 21:53:45 +02:00
Philip Mayer e49976bf8a Reduce docker container size by usage of slim bookworm #745 2025-08-21 00:04:56 +02:00
Donkie 92065fd8df Update python dependencies 2025-03-16 18:23:40 +01:00
Donkie 65bfba89cf Changed docker base image to Python 3.12 bookworm
Previously we had alpine but tbh its stupid
2024-05-23 20:14:13 +02:00
Donkie db18a5f19d Added libffi to fix armv7 builds
Thanks @spyder007
2024-04-01 22:15:27 +02:00
Donkie cccb0de982 Merge pull request #279 from hcooper/dynamic-port
Support dynamic ports
2024-02-01 18:25:04 +01:00
Donkie b40da6e2ee Updated commit and build date capturing
It's now written to a build.txt file instead of using environment variables internally. Standalone installs now has this properly as well.
2024-01-25 22:03:18 +01:00
hcooper 1273b20224 Support dynamic ports 2024-01-23 11:16:57 -08:00
Donkie 0be9ab5a8f Added PUID and PGID environment variable support 2023-12-29 11:18:25 +01:00
Donkie 60b67ee758 Dockerfile no longer builds client
This proved to be extremely slow on emulated hardware to build e.g. the linux/arm/v7 image.
Since the built client is architecture agnostic, it's instead now built on the native hardware and inserted into the docker image.
2023-12-17 22:53:17 +01:00
Donkie 83081c3ade Updated package dependencies and node to 20 2023-12-17 20:29:19 +01:00
Donkie fef41a5628 Added warning if in docker and data dir isn't mounted
Had to remove the VOLUME definition in the dockerfile for this, otherwise the data dir would always be mounted by an anonymous volume if the user didn't mount it correctly, so the python script wouldn't be able to detect it.
2023-11-07 21:45:58 +01:00
Donkie 1a3efd9ea9 Added git commit and build date env and API 2023-09-17 10:51:28 +02:00
Donkie e1065d4a3f Format Dockerfile 2023-09-04 20:22:41 +02:00
Markus Küffner 9ced024736 docker: set permissions for config directory and add volume directive 2023-09-01 09:38:13 +02:00
Donkie c6de1c403a Improved dockerfile client builder 2023-08-08 21:32:07 +02:00
Donkie 6173cf1d27 Install app as non-editable in dockerfile 2023-07-10 11:46:35 +02:00
Donkie a6ac5982cc Switched to PDM for package management 2023-07-10 01:13:40 +02:00
Donkie 06dfbf67f8 armv7 actually works now 2023-06-03 20:50:25 +02:00
Donkie 2ae4b88a14 armv7 build working 2023-06-03 19:55:03 +02:00
Donkie 9a6572d197 Fix .venv folder name 2023-06-03 13:40:51 +02:00
Donkie e4806591cc Progress towards armv7 Docker build 2023-06-03 12:26:19 +02:00
Donkie de1bf05922 Added Alembic for migrations 2023-05-27 23:14:06 +02:00
Donkie a35ca3e9ba Use venv in docker to try fix build issues 2023-05-18 15:46:41 +02:00
Donkie dce4cebb00 Attempt to fix build issue 2 2023-05-18 15:32:51 +02:00
Donkie 4802693579 Attempt to fix build issue 2023-05-18 14:47:21 +02:00
Donkie 3f12f97240 Updated license in dockerfile 2023-05-17 22:16:32 +02:00
Donkie 329c4c4675 Client: Don't hard code the API endpoint anymore 2023-05-14 20:21:25 +02:00
Donkie 8e21cd2e12 Updated Dockerfile command 2023-05-14 18:59:48 +02:00
Donkie 3f78632208 Added release workflow 2023-05-10 21:37:25 +02:00
Donkie 639a800efa Dockerfile now builds client 2023-05-10 21:26:24 +02:00
Donkie 77ffab61c5 Added a basic dockerfile 2023-04-05 22:09:13 +02:00