Refresh deploy/ and bin/ from the boilerplate at 09e144d (the release split between the distro and Windows, wsl-setup, the server config, USER 1000, python:3.15-slim) with roledesk's facts put back: no frontend stage, desk, plugins and seed copied, the extras passkeys, embeddings and llm, roles as the table the backup and the importer require, bin/pull.sh and bin/worker.sh with their profile commands, and Install Server.md and Install WSL.md as copies in place of the five old deployment docs

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-27 11:11:19 +01:00
1 parent 83e965dfeb
commit a1f281a23a
40 files changed
+2226 -1287

No files matched your search

+50 -16
View File
@@ -1,21 +1,28 @@
# A Python app, for a server rather than a laptop.
#
# Two stages so the runtime carries no build tooling: `uv` resolves and
# installs into /app/.venv, and the second stage copies that venv and the
# source next to it. The install is deliberately editable, which matters if
# the app reads a file from beside its package (an example config, a template
# directory): that path is true in a checkout and true here, and false in
# site-packages.
# installs into /app/.venv, and the second stage copies the venv and the source
# next to it. The install is deliberately editable, which matters because the
# app reads files from beside its package (templates, `app/static`, `seed/`):
# that path is true in a checkout and true here, and false in site-packages.
# Ours: roledesk has no `frontend/` and no Node stage, since the server renders
# Jinja templates and serves `app/static` as it is.
#
# Already in place at deploy/Dockerfile, with its ignore file beside it.
# 2-build-image.ps1 reads it out of a `git archive` of the production commit,
# so the recipe is versioned with the code it builds.
# 2-build-image.ps1 builds with it from the `git archive` of the production
# commit that step 1 exports, so the recipe is versioned with the code it builds.
#
# The package is `app` and stays `app` — a project started from this repo
# renames nothing. Edit the two `uv sync` lines when you add extras.
# The package is `app` and stays `app` (the domain noun is `role`). Edit the
# two `uv sync` lines when you add extras.
#
# Each base image is pinned by tag and digest: the tag says which release, the
# digest makes a rebuild next month install the same bytes. The digest is the
# multi-platform index's. To move on, look up the new tag's digest on its
# registry (Docker Hub's tag API for python, ghcr.io for uv) and
# replace both halves.
ARG PYTHON=3.14-slim
ARG UV=0.9.17
ARG PYTHON=3.15-slim@sha256:2da676046630d7bf14c6764ae1143dc7fa0377a53f94bf5a642f0b214aca5bce
ARG UV=0.13.1@sha256:4a1f3666816dafadd20ceb71eac9a7d56d7ef30279f7d64048519ab901ada336
FROM ghcr.io/astral-sh/uv:${UV} AS uv
@@ -32,22 +39,38 @@ WORKDIR /app
# Dependencies first and on their own layer, keyed on the lock file alone, so
# editing a Python file rebuilds in seconds rather than re-resolving the tree.
# The extras are the same on both `uv sync` lines: `passkeys`, without which
# the passkey routes answer 501, `embeddings`, the default ranking backend
# (torch comes from the CPU index named in pyproject.toml, [tool.uv.sources],
# not the CUDA build; the model itself is downloaded by the first `embed` job
# into HOME, which is the /data volume), and `llm`, the SDKs the compose file
# passes keys for.
COPY pyproject.toml uv.lock README.md ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --no-install-project
uv sync --frozen --no-dev --no-install-project \
--extra passkeys --extra embeddings --extra llm
COPY app app
# The two module folders this repo ships beside the app, here and again in the
# runtime stage below. `pyproject.toml` lists `pipeline*` and `auth*` in its
# packages as well, or the install leaves them out.
# The module folders this repo ships beside the app, here and again in the
# runtime stage below. `pyproject.toml` lists `pipeline*`, `auth*`, `llm*` and
# `desk*` in its packages as well, or the install leaves them out.
COPY pipeline pipeline
# The door. A project that does not want one drops this line *and* the
# `auth.connect` call in `app/main.py` together: dropping the folder and
# leaving the call is a container that fails at startup, and dropping the call
# and leaving the folder is a container that starts with the door open.
COPY auth auth
# The model call. Nothing imports it until an app adds its SDKs, and then the
# folder has to be here already, so that is not a Dockerfile edit.
COPY llm llm
# Ours: the source contract and the generic desk modules, the plugin folder the
# config's `plugin_paths` names, and the data a first run imports (`seed/`).
COPY desk desk
COPY plugins plugins
COPY seed seed
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
uv sync --frozen --no-dev \
--extra passkeys --extra embeddings --extra llm
# ---------------------------------------------------------------- runtime
@@ -69,6 +92,10 @@ COPY pipeline pipeline
# The login page and the two scripts are files inside this folder, served from
# routes; see the build stage above.
COPY auth auth
COPY llm llm
COPY desk desk
COPY plugins plugins
COPY seed seed
ENV PATH=/app/.venv/bin:$PATH \
PYTHONUNBUFFERED=1 \
@@ -79,6 +106,13 @@ ENV PATH=/app/.venv/bin:$PATH \
# /data, and a CLI the app shells out to — the `claude` binary, for one —
# wants somewhere to write. An image-baked /home/app would be right for uid
# 1000 and unwritable for anyone else.
#
# The image runs as 1000:1000, the compose file's default PUID:PGID and the
# owner docs/Install Server.md gives the data folder, so a `docker run` without a
# `user:` does not write root-owned files into it. /data is made here, before
# VOLUME, so an anonymous volume starts out owned by that uid too.
RUN install -d -o 1000 -g 1000 /data /data/home
USER 1000:1000
VOLUME /data
EXPOSE 8787