Skip to content

Examples

supplier-portal-api

The Supplier portal API lab: one lab, a recipe per form for each machine (containers or native VMs), so it runs on every target. The launch token reaches the database as a file, never as an environment variable; the API's URL isn't secret, so it is one.

The example's folder, with the files its spec names: examples/supplier-portal-api.

version: 1
name: supplier-portal-api

networks:
  lab: { cidr: 10.20.0.0/24 }

inputs:
  API_URL: { sensitive: false, description: "The API the portal calls." }
  LAUNCH_TOKEN: { description: "A token issued at launch, stored by the database's seed." }

machines:
  database:
    os: debian@12
    networks: { lab: 32 }
    ports: { mysql: 8207 }
    environment:
      API_URL: { input: API_URL }
      # The container form runs the mysql:8.0 image directly: it needs the image's own
      # settings. Root has no password (as the seed connects), and mysqld (and the mysql
      # client) listen on 8207, as the VM form's recipe configures MariaDB to. The image
      # enables the empty password on any non-empty value; "1" stays a string in every
      # generated manifest, where a bare `yes` would be read as a boolean.
      MYSQL_ALLOW_EMPTY_PASSWORD: "1"
      MYSQL_TCP_PORT: 8207
    files:
      - { path: /run/lab/launch-token, input: LAUNCH_TOKEN }
    resources: { cpus: 1, memory_mb: 1024 }
    app:
      image: mysql:8.0
      steps: [{ run: provision/database.sh }]
    setup: [build/database/seed.sh]   # reads the token from /run/lab/launch-token

  web:
    os: debian@12
    networks: { lab: 31 }
    ports:
      # The app's pages call localhost:8206 themselves: that host port or nothing.
      portal: { port: 8206, protocol: http, publish: { host: 8206, fixed: true } }
    depends_on: [database]
    resources: { cpus: 1, memory_mb: 1024 }
    app:
      build: build/web
      steps: [{ run: provision/web.sh }]

checks:
  - build/check/check.sh

Targets

docker, hosted, docker-vm, cloud-docker, kubernetes, vagrant, cloud-vm. See targets for what each means.

Checks

All derived: the checks Isoloom derives from the machines' ports and the reach rules. See checks.