Overview
The Stacks page provides comprehensive management of Docker Compose applications (stacks). It combines local compose file management with powerful Git integration, allowing you to deploy, monitor, and control multi-container applications with ease.Key Features
Stack Management
- Docker Compose Support: Full support for Docker Compose v2+ specifications
- Git Integration: Deploy stacks directly from Git repositories
- Stack Sources: Internal (database-stored), Git-based, or external (file-based)
- Real-Time Status: Live updates for all containers within a stack
- Aggregate Metrics: Combined CPU, memory, and network statistics for all stack containers
Stack Operations
Lifecycle Management:- Start: Start all stopped containers in a stack
- Stop: Stop all running containers without removing them
- Restart: Restart all containers in a stack
- Down: Stop and remove all containers, networks, and volumes
- Deploy: Deploy or redeploy from Git repository
- Select multiple stacks for batch operations
- Bulk start, stop, restart, or remove stacks
- Execute operations in parallel for faster processing
Git Integration Features
Repository Management:- Store multiple Git repositories with credentials
- Support for public and private repositories
- SSH and HTTPS authentication
- Branch selection and automatic updates
- Deploy from compose files in Git repositories
- Configure compose file path (default:
compose.yaml) - Environment variables stored separately from Git
- Automatic webhook support for CI/CD pipelines
- Schedule automatic pulls from Git
- Daily, weekly, or custom cron expressions
- Manual trigger for immediate updates
- Webhook integration for push-based updates
Stack Types
Internal Stacks:- Compose files stored in Dockhand database
- Inline YAML editor with syntax highlighting
- Environment variable management
- Easy editing and version control
- Linked to Git repositories
- Automatic synchronization
- Supports multi-file compose setups
- Environment variable overrides
- Detected from compose files on disk
- File path stored for future operations
- Can be “adopted” to convert to internal stack
Container Details View
Expand stacks to see all containers:- Container name and status
- Image name and tag
- Health check status
- Uptime and resource usage
- IP address and ports
- Network and volume information
- Start/stop individual containers
- Restart or pause containers
- View logs for specific container
- Open terminal session
- Inspect container details
- Browse container filesystem
Filtering and Search
- Text Search: Filter by stack name or status
- Status Filter: Running, partial, stopped, created, not deployed
- Multi-Status Selection: Combine multiple status filters
- Driver Filter: Filter by network driver type
- Persistent Filters: Saved to local storage
UI Features
Expandable Rows:- Click stack name to expand/collapse
- Shows all containers with details
- Sparkline graphs for resource trends
- Per-container action buttons
- Running: All containers running (green)
- Partial: Some containers running (amber)
- Stopped: All containers stopped (red)
- Created: Stack created but not deployed (gray)
- Not Deployed: Git stack not yet deployed (violet)
- Horizontal: Logs panel at bottom
- Vertical: Logs panel on right side
- Resizable panel widths
- Persistent layout preference
How to Use
Creating an Internal Stack
- Click the Create button
- Configure Stack:
- Enter a unique stack name
- Paste or write your Docker Compose YAML
- Add environment variables (optional)
- Validation:
- YAML syntax is validated automatically
- Errors are highlighted inline
- Click Create to save and deploy
- Stack deploys automatically after creation
Deploying from Git
- Click From Git button
- Select or Add Repository:
- Choose existing repository
- Or add new repository with URL and credentials
- Configure Deployment:
- Enter stack name
- Select branch (default: main)
- Set compose file path (default: compose.yaml)
- Add environment variables
- Advanced Options:
- Enable auto-update with schedule
- Configure webhook for push-based deployment
- Click Deploy to start deployment
- Monitor progress in real-time
Adopting an External Stack
- Click Adopt button
- External stacks are listed (detected from compose files)
- Select stack to adopt
- Review compose file content
- Click Adopt to convert to internal stack
- Stack is now editable in Dockhand
Managing Stack Lifecycle
Starting a Stack:- Find stopped stack in the list
- Click the Start button or select and use bulk action
- All containers start in dependency order
- Status updates to “Running” or “Partial”
- Find running stack
- Click Stop button
- Confirmation dialog appears
- Containers stop gracefully (10s timeout, then force kill)
- Click Down button (⬇️ icon)
- Confirm destructive action
- Containers, networks, and anonymous volumes are removed
- Named volumes are preserved
Editing Stacks
Internal Stacks:- Click the stack name
- YAML editor opens with current compose file
- Make changes and click Save
- Stack automatically redeploys with new configuration
- Click the Git icon to open Git stack modal
- View repository, branch, and compose path
- Change branch or compose path if needed
- Update environment variables
- Click Redeploy to pull latest changes
Viewing Logs
All Stack Logs:- Click Logs icon on stack row
- Navigates to Logs page with all stack containers pre-selected
- Logs are interleaved by timestamp
- Stack name shown in filter
- Expand stack to show containers
- Click Logs icon on specific container
- Logs panel opens at bottom (or side)
- Real-time streaming with search
Managing Environment Variables
- Open stack for editing
- Click Environment Variables tab
- Add variables:
- Key=Value pairs
- Supports multiline values
- Auto-complete for common variables
- Variables are encrypted in database
- Variables override .env files from Git
UI Walkthrough
Header Section
- Title: “Compose stacks” with total count
- Expand/Collapse All: Toggle all stacks at once
- Search Bar: Filter stacks by name or status
- Status Filter: Multi-select for stack states
- Refresh: Manually refresh stack list
- Layout Toggle: Switch between horizontal/vertical
- From Git: Deploy stack from Git repository
- Create: Create new internal stack
- Adopt: Convert external stack to internal
Selection Bar
Appears when stacks are selected:- Number of selected stacks
- Clear: Deselect all stacks
- Start: Start selected stopped stacks
- Restart: Restart selected running stacks
- Stop: Stop selected running stacks
- Down: Remove selected stacks
- Remove: Delete selected stack definitions
Stack Table
Columns:- Checkbox: Select for bulk operations
- Expand: Arrow icon to show/hide containers
- Name: Stack name (clickable for internal stacks)
- Status: Running/Partial/Stopped/Not deployed
- Containers: Number of containers in stack
- Source: Internal/Git/External badge
- Environment Variables: Count badge (if any)
- CPU: Aggregate CPU usage
- Memory: Total memory usage
- Networks: Number of unique networks
- Volumes: Total volume count
- Actions: Quick action buttons
- Git: Open Git stack configuration (Git stacks only)
- Edit: Edit compose file (Internal stacks only)
- Start/Stop: Control stack lifecycle
- Restart: Restart all containers
- Down: Stop and remove stack
- Logs: View aggregated logs
- Remove: Delete stack definition
Expanded Container View
Container Columns:- Name: Container name
- Image: Image name and tag
- Status: Running/Stopped/Paused/Exited
- Health: Health check status with icon
- Uptime: Time since container started
- IP: Container IP address
- Ports: Published ports (clickable)
- CPU/Memory: Resource usage with sparklines
- Network: Rx/Tx with trend graph
- Disk: Read/Write with trend graph
- Actions: Per-container controls
Real Examples
Example: WordPress Stack
Example: Microservices Stack
Example: Git Repository Structure
- Repository URL:
https://github.com/myorg/my-app.git - Branch:
main - Compose Path:
compose.yaml - Auto-Update: Daily at 3:00 AM
- Webhook: Enabled with secret token
Database Schema
compose_stacks (Internal stacks):- Stack name and environment ID
- Compose file content (YAML)
- Source type: internal, external, git
- Compose file path (for external)
- Repository and branch info (for Git)
- Created and updated timestamps
- Stack-specific environment variables
- Encrypted values
- Overrides for Git-based stacks
- Repository URL and credentials
- Branch and compose file path
- Auto-update schedule and cron expression
- Webhook configuration
- Links stacks to Git repositories
- Deploy status and last deployment time
- Error messages from failed deployments
Technical Details
Compose File Processing
- YAML Parsing: Uses js-yaml for syntax validation
- Variable Substitution: Environment variables expanded at runtime
- Multi-File Support: Supports compose file inheritance
- Validation: Pre-deployment validation of compose syntax
Git Operations
- Clone: Shallow clone for faster deployment
- Pull: Fetch latest changes from branch
- Authentication: SSH keys or HTTPS credentials
- Webhooks: GitHub, GitLab, Bitbucket compatible
API Endpoints
GET /api/stacks- List all stacksPOST /api/stacks- Create internal stackGET /api/stacks/sources- Get stack sourcesGET /api/stacks/:name- Get stack detailsPUT /api/stacks/:name- Update stackDELETE /api/stacks/:name- Remove stackPOST /api/stacks/:name/start- Start stackPOST /api/stacks/:name/stop- Stop stackPOST /api/stacks/:name/restart- Restart stackPOST /api/stacks/:name/down- Bring down stackGET /api/git/stacks- List Git stacksPOST /api/git/stacks/deploy- Deploy Git stackPOST /api/git/stacks/:name/redeploy- Redeploy Git stack
