Skip to content

Volume Management

Griffen Fargo edited this page Apr 10, 2026 · 1 revision

Volume Management

strut provides dynamic volume management driven by volume.conf in each stack.

Commands

strut my-stack volumes status --env prod     # Show volume status
strut my-stack volumes init --env prod       # Initialize volumes
strut my-stack volumes config --env prod     # Show volume configuration

volume.conf

Define volume mappings in stacks/<stack>/volume.conf:

# volume_name:host_path:container_path:owner_uid:owner_gid
postgres_data:/var/lib/postgresql/data:/var/lib/postgresql/data:999:999
uploads:/app/uploads:/app/uploads:1000:1000
redis_data:/data:/data:999:999

Volume Initialization

strut my-stack volumes init --env prod

Creates host directories, sets ownership, and ensures volumes are ready before deployment.

Reusing Existing Volumes

When migrating from an existing setup, reference existing Docker volumes:

# In docker-compose.yml
volumes:
  postgres-data:
    external: true
    name: existing_postgres_data

Stopping with Volume Cleanup

# Stop containers only
strut my-stack stop --env prod

# Stop and remove volumes (⚠️ data loss)
strut my-stack stop --env prod --volumes

Clone this wiki locally