Skip to content

Deployment topology

PerfShop ships with two deployment topologies maintained in parallel, which share the exact same list of services and the same naming conventions:

Target Compose file Mode Audience
Docker Desktop docker-compose.desktop.yml Local Windows / macOS build Independent instructor, peer-to-peer demo
Linux / VPS / CI docker-compose.build.yml Local Linux build University, training organization, self-hosted deployment

Both modes are orchestrated by the build.sh script (and its Windows counterpart build.bat), which generates the .env file from the .env.example template, builds the custom images, then runs docker compose up -d.

Without an argument, ./build.sh opens a menu of the three targets — unix, desktop and prod (a server with your own domain names, whose .env is prepared by hand) —, says what each one needs and proposes the one detected on the machine. With a target (./build.sh desktop), no menu; --silent requires the target. Without a terminal (ssh without -t, scheduled task), the installer cannot ask its questions: at the first one, it stops, says so and returns code 1 — then run it with --silent and the options that answer them (--lang, --ip, --license); the two questions asked after a successful deployment (push to Forgejo, welcome page) are only skipped.

Source of truth

The lists of services, ports, volumes and environment variables described on this page are taken from the two compose files listed above. Both compose files have strictly the same list of application services; only the way images are produced differs (local build + node_modules cache in named volumes).

Overview

flowchart TB
  subgraph dev["User's machine / server"]
    direction TB
    user["Browser<br/>(instructor or student)"]

    subgraph engine["Docker Engine"]
      direction TB
      net["perfshop-network<br/>(dedicated bridge)"]
      svc["PerfShop services<br/>(shop, chaos, obs, QA, games)"]
      vol["Named volumes + bind mounts<br/>(persisted data)"]
      net --- svc
      svc --- vol
    end

    user -->|http://&lt;host&gt;:&lt;port&gt;| svc
  end

Whatever the target, the topology stays identical:

  • A single perfshop-network Docker bridge network isolates inter-service communications and enables DNS resolution by container name.
  • Each application service exposes its port on the host according to environment variables (*_HTTP_PORT) — see network.md for the full table.
  • Persistent data (MySQL, Grafana, Loki, Tempo, Pyroscope, OpenSearch, Forgejo, Squash DB, etc.) lives in named Docker volumes managed by the engine — no sensitive bind mount on the host side.
  • Seeds (perfshop-grafana-seed, perfshop-squash-seed, perfshop-forgejo-seed, perfshop-opensearch-seed) run at every docker compose up, then stop (restart: "no"); idempotent, they recreate nothing that exists and exit with code 1 on failure. They wait for the service_healthy status of their targets before launching their initialization. All of them run on the python:3.11-slim image with the standard library only: nothing is downloaded or built when they start (first startup possible without Internet access, measured on 2026-09-28 for the OpenSearch, Forgejo and Squash seeds). The class accounts seed, perfshop-comptes-seed, follows the same cycle on the node:24.15.0-alpine image (Node only, mounted code); it exits with 1 if an account is in error, with 2 if the list or the configuration is faulty (Class accounts).

Target 1 — Docker Desktop (Windows / macOS)

flowchart LR
  subgraph host["Developer / instructor machine"]
    subgraph dd["Docker Desktop"]
      direction TB
      img["PerfShop images<br/>locally built<br/>perfshop-backend, perfshop-frontend,<br/>perfshop-admin, perfshop-chaos-admin,<br/>perfshop-monitoring, perfshop-welcome,<br/>perfshop-test-runner"]
      run["Running containers"]
      img --> run
    end
    browser["Chrome / Firefox browser<br/>http://localhost:&lt;PORT&gt;"]
    browser --> run
  end

Launch

./build.sh desktop

The build.sh script in desktop mode:

  1. Offers an interactive prompt (language, host address, license key), then regenerates .env from .env.example with the chosen address — on every run.
  2. Locally builds the custom images from the Dockerfiles present in the backend/, frontend/, admin/, chaos-admin/, monitoring/, welcome/, games/, test-runner/ folders.
  3. Loads the docker-compose.desktop.yml compose file.
  4. Runs docker compose up -d to start everything in the background.
  5. Displays the URL of the perfshop-welcome page that acts as a directory pointing to all exposed services.

Silent mode for automation:

./build.sh desktop --silent --ip=192.168.1.10 --license=PFSH-xxx.yyy --lang=fr

The host's address, never localhost

--ip expects the machine's address on the network — the one the script detects and offers. localhost and 127.0.0.1 are refused: seen from a container, localhost is the container itself, so UI tests (Robot, Selenium) and JMeter runs against the external target would fail. Without --ip, silent mode picks the interface that holds the default route; if it detects none, it stops and asks for the address.

The host address changed

A laptop moving to another network, a renewed DHCP lease: the addresses written in .env lead nowhere. Running the installation again would regenerate the whole .env and rebuild the images. Instead:

./build.sh desktop --update-ip=192.168.1.20

The command rewrites only the addresses of the existing .env — the license, the language and your own settings are kept — then recreates the services whose address changes, without rebuilding the images. Without a value (--update-ip), the script detects the address (silent mode) or offers it. It applies to the desktop and unix targets; on nas and prod, the .env addresses are set by hand.

The class accounts

./build.sh desktop --comptes

Replays the accounts seed of the class alone — one PerfShop account and one Squash TM account per student of classe/comptes.csv —, without rebuilding or restarting anything; --comptes=verifier, --comptes=retirer and --comptes=supprimer complete the gesture. See Class accounts.

Docker Desktop specifics

Aspect Detail
Custom images Built on the machine via docker build (Docker Desktop supports all required seccomp profiles and capabilities)
MySQL data The tree's ./mysql-data folder, mounted on /var/lib/mysql (host mount, not a named volume): the data can be inspected directly when needed
JMeter UI node_modules Named volume jmeter-ui-modules: under Docker Desktop, the JMeter UI code is mounted on /app and its dependencies stay in this volume from one restart to the next (the other Node interfaces carry theirs in their image)
Performance Docker Desktop's virtualized filesystem is slower for massive bind mounts; named volumes are preferred for hot data
Ports reserved by Windows Hyper-V NAT (WinNAT) reserves port ranges that change from one boot to the next (netsh interface ipv4 show excludedportrange protocol=tcp). On every run, the installer replaces in .env any published port that falls in a range with the first free port from port + 10,000 (outside the ranges and the stack's own ports), addresses included, and says so on screen (e.g. SQUASH_DB_PORT : 5433 → 15433); no free port: it stops before deploying. Linux and macOS are not affected.
Networking Services are published on the host address given to the installer (never localhost, see above); host.docker.internal if a container needs to call a resource on the host machine

Target 2 — Linux / VPS / CI

flowchart LR
  subgraph vps["Linux server or VPS"]
    subgraph engine2["Native Docker Engine"]
      direction TB
      img2["PerfShop images<br/>locally built on the server"]
      run2["Running<br/>containers"]
      img2 --> run2
    end
    rp["Reverse proxy<br/>(optional)<br/>nginx, Caddy, Traefik..."]
    rp --> run2
  end
  internet["Students / instructors<br/>(browser)"] -->|HTTPS| rp

Launch

./build.sh unix

The build.sh script in unix mode follows the same flow as desktop mode, but uses the docker-compose.build.yml compose file adapted to the native Linux Docker engine. This is the recommended mode for:

  • An installation on a VPS dedicated to training (training organization, university)
  • A continuous integration pipeline that validates the full stack on every commit
  • A deployment on an internal Linux machine (lab, classroom)

Silent mode:

./build.sh unix --silent --ip=10.0.0.5 --lang=en --license=PFSH-xxx.yyy

The address rules are those of the desktop target: never localhost, and ./build.sh unix --update-ip=10.0.0.9 when the server's address changes.

Upstream reverse proxy

On a VPS, you typically place an external reverse proxy (nginx, Caddy, Traefik…) in front of the PerfShop stack to:

  • Terminate TLS and expose the platform over HTTPS
  • Map readable subdomains to application ports (shop.example.com → :8090, grafana.example.com → :3002, etc.)
  • Share Let's Encrypt certificates
  • Filter sensitive tools by IP (chaos-admin, admin, Squash TM)

This layer is outside the PerfShop scope: the platform exposes plain HTTP ports, and it is up to the operator to choose and configure the reverse proxy of their choice. Domain conventions, exposed ports and the PUBLIC_*_URL variables to set in the .env are described in network.md.

Environment variables

Both modes read their configuration from a .env file at the project root, generated from the versioned .env.example template. The full detail of variables will be given in a dedicated appendix; here are the main groups:

Group Example variables Role
HTTP ports BACKEND_HTTP_PORT, FRONTEND_HTTP_PORT, GRAFANA_HTTP_PORT, CHAOS_HTTP_PORT, ADMIN_HTTP_PORT, JMETER_UI_PORT, SCRIPTS_UI_PORT, FORGEJO_HTTP_PORT, OPENSEARCH_HTTP_PORT… Container port → host port mapping
Public URLs PUBLIC_API_URL, PUBLIC_FRONTEND_URL, PUBLIC_MONITORING_URL, PUBLIC_GRAFANA_URL, PUBLIC_CHAOS_URL, PUBLIC_ADMIN_URL, PUBLIC_DOCS_URL, PUBLIC_JMETER_URL, PUBLIC_SCRIPTS_URL, PUBLIC_FORGEJO_URL, PUBLIC_OPENSEARCH_URL… Injected into CORS, into the React frontend (VITE_*), into the welcome page, and into backend links
Database DB_PASSWORD, DB_ROOT_PASSWORD, SQUASH_DB_PASSWORD MySQL and Squash PostgreSQL passwords
Accounts PERFSHOP_ADMIN_EMAIL, PERFSHOP_ADMIN_PASSWORD, SQUASH_ADMIN_LOGIN, SQUASH_ADMIN_PASSWORD, FORGEJO_ADMIN_USER, FORGEJO_ADMIN_PASSWORD, FORGEJO_CI_USER, FORGEJO_CI_PASSWORD Superadmin accounts and CI accounts bootstrapped at startup
Sessions SESSION_COOKIE_SECURE, SESSION_COOKIE_SAME_SITE, SESSION_SECRET HTTP session cookie policy on the backend and Node UIs
License PERFSHOP_LICENSE_KEY PerfShop license key (this variable takes precedence, otherwise the perfshop_license DB table is used)
Language PERFSHOP_LANG (fr or en), PERFSHOP_UI_LOCALE Default language for the backend, frontend, Grafana and Forgejo

Passwords

The default values in .env.example are intentionally trivial (perfshop, perfshop123) to allow immediate startup in a pedagogical environment. Any public network exposure requires changing them before the first start.

Healthchecks and startup order

Services that have "warm start" dependencies use the Compose depends_on: condition: service_healthy mechanism:

flowchart LR
  db[("perfshop-db<br/>healthcheck mysqladmin ping")] --> app["perfshop-app"]
  tempo["perfshop-tempo"] --> app
  pyro["perfshop-pyroscope"] --> app

  graf[("grafana<br/>healthcheck /api/health")] --> gseed["grafana-seed"]

  sqdb[("perfshop-squash-db<br/>healthcheck pg_isready")] --> tm[("perfshop-testmgmt<br/>healthcheck /isSquashAlive")]
  tm --> sseed["squash-seed"]
  tm --> orch["perfshop-orchestrator"]

  fg[("perfshop-forgejo<br/>healthcheck /api/v1/version")] --> fseed["forgejo-seed"]
  fseed --> sseed
  sseed --> cseed["comptes-seed"]
  app --> cseed
  fg --> sui["perfshop-scripts-ui"]

  os[("perfshop-opensearch<br/>healthcheck /_cluster/health")] --> osd["perfshop-opensearch-dashboards"]
  osd --> oseed["opensearch-seed"]
  os --> vec["perfshop-vector"]

  relay[("perfshop-docker-relay<br/>healthcheck healthcheck.js")] --> sui
  relay --> fseed
  relay --> vec
  relay --> others["perfshop-jmeter-ui, perfshop-test-ai,<br/>perfshop-monitoring, perfshop-promtail"]

In practice:

  • perfshop-app waits for MySQL to respond to mysqladmin ping, and for Tempo and Pyroscope to be running (so the first traces and profiles aren't lost).
  • perfshop-grafana-seed waits for Grafana to respond to /api/health before setting the folder ACLs, creating the "Ateliers élèves" folder and the student account, and configuring the homes (exit code 1 on failure).
  • perfshop-testmgmt (Squash TM) waits for PostgreSQL; perfshop-squash-seed waits for Squash TM to be healthy AND for the successful completion of perfshop-forgejo-seed (which creates the CI account used for the SCM connection).
  • perfshop-comptes-seed only requires the backend and perfshop-squash-seed to have started, then waits itself (bounded) for the backend, Squash TM and the PerfShop QA project, which receives the students' permission: an upstream failure does not fail the deployment.
  • perfshop-orchestrator waits for Squash TM to be healthy and Test Runner to be started.
  • perfshop-scripts-ui waits for perfshop-app, Forgejo healthy and Test Runner started.
  • perfshop-vector and perfshop-opensearch-dashboards wait for OpenSearch to be healthy; perfshop-opensearch-seed waits for both.
  • The clients of the Docker relay — perfshop-scripts-ui, perfshop-jmeter-ui, perfshop-test-ai, perfshop-forgejo-seed, perfshop-monitoring, perfshop-vector, perfshop-promtail — wait for perfshop-docker-relay to be healthy: it is through it, not the daemon socket, that they call the Docker API (see Docker socket: the relay).

This sequence ensures that on the first up -d, the user has no manual initialization step to perform: Grafana has its ACL, Squash TM has its project, Forgejo has its repository and its token, OpenSearch has its index templates and its dashboards.

To go further

  • Technical stack — versions and images of each component
  • Docker Compose — exhaustive inventory of the services and their volumes
  • Network and domains — port mapping, DNS conventions, internal flows
  • Local development section — Forgejo cloning, backend/frontend build, Git workflow