Skip to content

Examples

hello-stack

A web server and a cache, as containers or as native VMs, with the same behavior: the page answers on web:80, the cache holds the greeting seeded at start, and nothing reaches the internet.

Tested: Runs in CI on Docker with its checks, and was run on VirtualBox.

version: 1
name: hello-stack

networks:
  app: { cidr: 10.60.0.0/24, internet: false }

machines:
  cache:
    networks: { app: 20 }
    services: [{ port: 6379, name: redis }]
    volumes: { data: /data }
    docker:
      image: "redis:7-alpine"
      init: [build/cache/seed.sh]
    vm:
      os: debian-12
      provision: [provision/cache.sh]

  web:
    networks: { app: 10 }
    services: [{ port: 80, http: true, publish: 8080 }]
    depends_on: [cache]
    docker:
      build: build/web
    vm:
      os: debian-12
      provision: [provision/web.sh]

checks:
  - checks/web-answers.sh
  - checks/cache-seeded.sh
  - checks/no-internet.sh

Targets

docker, hosted, cloud-docker, vagrant, proxmox, cloud-vm. See Targets for what each means.

Checks

  • checks/web-answers.sh
  • checks/cache-seeded.sh
  • checks/no-internet.sh

See Checks.