Files
app/.gitea/workflows/test-compose.yml
T
stroblmeandClaude Opus 5.5 48aac3855b 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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:40:02 +02:00

76 lines
3.1 KiB
YAML

name: Compose Smoke Test
# Lives in this repository rather than the workspace root: the stack it starts
# is entirely app-local (docker/compose*.yml + .env.example). A root workflow
# would additionally need a token to check out the private submodules and would
# have to run scripts/setup.sh to generate secrets, for the same coverage.
on:
push:
branches:
- main
paths:
- backend/**
- frontend/**
- docker/compose*.yml
- .env.example
- .gitea/workflows/test-compose.yml
pull_request:
types:
- opened
- synchronize
paths:
- backend/**
- frontend/**
- docker/compose*.yml
- .env.example
- .gitea/workflows/test-compose.yml
# A new push supersedes the run still queued for the commit before it. Without
# this each commit leaves its own run in the queue and a runner that was offline
# for a while works through a backlog of results nobody will read.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# compose.ci.yml drops the fixed container_names and host ports so this job
# can share a runner host with the Playwright shards.
COMPOSE_FILE: docker/compose.yml:docker/compose.dev.yml:docker/compose.ci.yml
# Own project name so this job's `down -v` cannot reach another stack.
COMPOSE_PROJECT_NAME: fluksio-app-ci-compose
jobs:
test-compose:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write .env
run: cp .env.example .env
# 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 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, which has python and no curl.
- name: Backend is up
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 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
# the teardown below removes.
if: failure()
run: docker compose logs --no-color --tail 200
- name: Tear down
if: always()
run: docker compose down -v --remove-orphans