Skip to main content

Compose Stacks

HYPR supports Docker Compose files for deploying multi-service applications as coordinated VM stacks.

Deploying a Stack

This searches for compose files in the current directory:
  1. hypr-compose.yml, hypr-compose.yaml
  2. Hyprfile, Hyprfile.yml, Hyprfile.yaml
  3. docker-compose.yml, docker-compose.yaml
  4. compose.yml, compose.yaml
Specify a file explicitly:

Stack Management

List Stacks

Stack Details

Destroy Stack

Force without confirmation:

Compose File Format

HYPR supports Docker Compose v2 and v3 syntax.

Basic Example

Service Configuration

image

Container image to run.

build

Build image from Dockerfile.

ports

Map host ports to container ports.

environment

Set environment variables.

Automatic .env Loading

HYPR automatically loads .env from the compose file directory, just like Docker Compose. No configuration needed.

env_file

Load additional environment files beyond the automatic .env.
Priority order (later overrides earlier):
  1. .env (auto-loaded from compose directory)
  2. env_file entries (in order listed)
  3. environment section (highest priority)
Env files use KEY=VALUE format, one per line. Comments (#) and empty lines are ignored. Values can be quoted.

volumes

Mount volumes into the VM. See Volumes for details.

depends_on

Set service dependencies.
Services start in dependency order. The web service waits for db and cache to be running before starting.

networks

Connect to networks. See Networking for details.
Services on the same network can communicate by service name:

command

Override the default command.

entrypoint

Override the entrypoint.

working_dir

Set working directory.

user

Set user.

labels

Add metadata labels.

Resource Limits

Use the deploy section to set resource constraints.

Networks

Default Network

By default, all services in a stack share a default network and can communicate by service name.

Custom Networks

Define isolated networks:
In this example:
  • proxy can reach api but not db
  • api can reach both proxy and db
  • db can only reach api

Network Configuration

Volumes

Named Volumes

The volume is created as <stack-name>_pgdata and persists after compose down.

Bind Mounts

Volume Options

Complete Example

Deploy:

Command Options

hypr compose up

hypr compose down

hypr compose ps

List all stacks or show details of specific stack.

hypr compose logs

Show logs for a service.

Stack Naming

By default, stacks are named after the directory containing the compose file. Override with --name:
The stack name is used to prefix:
  • VM names: myproject-web, myproject-api
  • Volume names: myproject_pgdata
  • Network names: myproject_frontend

Environment Variable Substitution

Use variables in compose files:
Set in .env:
Or export: