One image for the whole app: engine, API and dashboard on one port

The backend image now builds the SPA and serves it on the API's own origin
(fluksio/spa.py), so an instance is a single container with no proxy, DNS,
port 80 or .env: `docker compose up -d` with the new compose.yml runs it on
localhost:8080. It starts on fluksio serve (persisted secret key, first
admin printed once) and brings its own Redis when REDIS_HOST is unset.

Slimmer: python:3.13-slim, no dev group, uv once, fastapi without the cloud
CLI. Optional features are per-feature extras (mqtt, influx, email, sentry,
ml, server for all) picked with the EXTRAS build argument; numpy moved to
`ml`. ffmpeg left the image for imageio-ffmpeg via the Modules screen.

The operator stack runs the same image with app. and api. routed to it; the
nginx frontend service, the LAN nginx proxy and DOMAIN in the backend are
gone, and the MCP issuer is FRONTEND_HOST.
This commit is contained in:
2026-10-16 11:40:02 +02:00
parent 9d9dac0bd0
commit dea25ec08d
39 changed files with 573 additions and 728 deletions
+4 -6
View File
@@ -30,8 +30,8 @@ concurrency:
env:
# The playwright runner service comes from the dev overlay. It loads the SPA
# from the nginx `frontend` service and reaches the API as http://backend:8000
# on the project network — both wired up in compose.ci.yml.
# and reaches the API on http://backend:8000, one origin on the project
# network, wired up in compose.ci.yml.
COMPOSE_FILE: docker/compose.yml:docker/compose.dev.yml:docker/compose.ci.yml
# frontend/playwright.config.ts keys the blob reporter, the retries and
# forbidOnly off CI, and compose.dev.yml forwards it into the container.
@@ -63,11 +63,9 @@ jobs:
# Not committed; compose interpolates it and the runner container reads
# FIRST_SUPERUSER / FIRST_SUPERUSER_PASSWORD out of it (tests/config.ts).
run: cp .env.example .env
- run: docker compose build backend frontend playwright
- run: docker compose build backend playwright
- run: docker compose down -v --remove-orphans
# PLAYWRIGHT_BASE_URL points the browser at `frontend`, which is not a
# dependency of the playwright service, so bring it up explicitly.
- run: docker compose up -d --wait backend frontend
- run: docker compose up -d --wait backend
# Named rather than --rm: the report is written inside the container, and
# compose.ci.yml drops the mount that would have put it on this
# filesystem — under a sibling daemon that mount lands somewhere this job
+12 -14
View File
@@ -48,24 +48,22 @@ jobs:
uses: actions/checkout@v4
- name: Write .env
run: cp .env.example .env
# The Playwright job runs the SPA off a Vite server inside its own
# container, so the nginx image is only ever built there. This job is what
# covers it — the SPA fallback in frontend/nginx.conf is the part that
# breaks silently.
- run: docker compose build backend frontend
# The image serves the dashboard too; its SPA fallback (fluksio/spa.py)
# is the part that breaks silently.
- run: docker compose build backend
- run: docker compose down -v --remove-orphans
# Redis comes along as a depends_on; --wait blocks on the backend
# healthcheck in docker/compose.yml, which is also what proves the
# schema was created before anything served a request.
- run: docker compose up -d --wait backend frontend
# Redis comes along as a depends_on; --wait blocks on the image's
# healthcheck (backend/Dockerfile), which is also what proves the schema
# was created before anything served a request.
- run: docker compose up -d --wait backend
# Nothing is published on the host (compose.ci.yml), so the checks run
# from inside the backend container against the project network.
# from inside the backend container, which has python and no curl.
- name: Backend is up
run: docker compose exec -T backend curl -f http://localhost:8000/api/v1/utils/health-check/
- name: Frontend is up
run: docker compose exec -T backend curl -f http://frontend/
run: docker compose exec -T backend python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/utils/health-check/')"
- name: Dashboard is up
run: docker compose exec -T backend python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/')"
- name: An authenticated route serves the SPA shell
run: docker compose exec -T backend curl -f http://frontend/flows
run: docker compose exec -T backend python -c "import urllib.request; assert b'<div id=\"root\"' in urllib.request.urlopen('http://localhost:8000/flows').read()"
- name: Container logs
# `up --wait` reports only that a container exited, never why. Without
# this the whole failure is one line and the reason dies with the stack