docker-compose.yml file. This is ideal for complex applications that require multiple services working together.
What is Docker Compose?
Docker Compose is a tool for defining and running multi-container Docker applications. With Dokploy, you can deploy entire application stacks that include:- Multiple interconnected services
- Databases and caching layers
- Message queues and background workers
- Reverse proxies and load balancers
- Any combination of containerized services
Multi-Service
Deploy multiple containers that work together as a single application stack.
Service Dependencies
Define relationships and dependencies between services.
Shared Networks
Services automatically share a network for seamless communication.
Templates
Use pre-built templates for popular application stacks.
Compose vs Stack Mode
Dokploy supports two deployment modes for Docker Compose:- docker-compose
- stack
Standard Docker Compose mode using
docker compose CLI:- Suitable for single-server deployments
- Simpler configuration
- Direct mapping of compose file features
- Recommended for most use cases
Creating a Compose Deployment
Compose deployments are created within environments, similar to applications and databases.Basic Configuration
Display name for your compose deployment
Unique internal identifier (auto-generated if not provided)
Optional description to help identify the deployment’s purpose
The complete docker-compose.yml content
Deployment mode:
docker-compose or stackThe environment where this compose deployment will be created
Source Types
Compose deployments support multiple source options:Git Repositories
- GitHub
- GitLab
- Bitbucket
- Custom Git
Raw Compose File
Paste or upload your docker-compose.yml content directly:Environment Variables
Compose deployments support environment variable substitution:Setting Variables
Using Variables in Compose File
Variables from the environment and project levels are automatically inherited. Compose-level variables take precedence.
Isolated Deployments
Dokploy supports isolated compose deployments, which modify service names to enable multiple instances:Enable isolated deployment mode
Suffix to append to service names (auto-generated if not provided)
How It Works
When isolated deployments are enabled:- Service names get a unique suffix:
webbecomesweb-abc123 - Container names are similarly modified
- Networks are isolated per deployment
- Volume names can be isolated (optional)
Example
Original compose file:abc123):
Randomization
Randomization automatically generates unique identifiers for services:Enable service name randomization
Domain Configuration
Compose deployments can have multiple domains configured for routing traffic to specific services:Adding Domains
Multiple Services, Multiple Domains
File Mounts
Inject configuration files into your compose deployment:Automatic Deployments
Automatically deploy when changes are pushed to the repository
When to trigger deployments:
push or pull_requestOnly trigger deployments when specific paths change
Watch Paths Example
Deploying Templates
Dokploy provides pre-built templates for popular application stacks:Available Templates
Fetch available templates:- WordPress + MySQL
- Ghost + MySQL
- Nextcloud + PostgreSQL
- GitLab + PostgreSQL + Redis
- Directus + PostgreSQL
- And many more…
Deploying a Template
- Environment variables with secure defaults
- Persistent volume mounts
- Domain configuration
- Service dependencies
Managing Services
View and manage individual services within your compose deployment:Loading Services
- Service names
- Image names
- Port mappings
- Environment variables
- Volume mounts
- Network configuration
Service Volumes
View volume mounts for a specific service:Deployment Operations
Manual Deployment
Trigger a deployment manually:Rebuild Deployment
Rebuild without fetching latest code:Start/Stop
Control the compose stack:Advanced Features
Custom Commands
Override the default docker compose command:Custom command to append to
docker composeSubmodule Support
Clone Git submodules when fetching repository
Fetch Source Type
Load the latest compose file from the repository:Get Converted Compose
Get the final compose file with all transformations applied (variables substituted, domains added, etc.):Importing Templates
Import custom templates or configurations:- Docker compose file content
- Configuration (environment variables, domains, mounts)
Database Schema
Compose deployments are stored with the following structure:Monitoring & Logs
Deployment Logs
View logs for the deployment process:- Service build output
- Pull progress
- Container startup logs
- Error messages
Service Logs
Access logs for individual services:Resource Usage
Monitor resource consumption for all services in the stack:- Combined CPU usage
- Total memory usage
- Network traffic
- Disk I/O
Best Practices
Pin Image Versions
Pin Image Versions
Always use specific image tags instead of
latest to ensure reproducible deployments:Use Health Checks
Use Health Checks
Define health checks for services to ensure proper startup order and monitoring:
Organize with Labels
Organize with Labels
Use labels to organize and document your services:
Use Isolated Deployments for Testing
Use Isolated Deployments for Testing
Enable isolated deployments when you need to test changes without affecting production.
Keep Secrets Secure
Keep Secrets Secure
Never commit secrets to your compose file. Use environment variables instead:
Troubleshooting
Services Won’t Start
- Check the deployment logs for error messages
- Verify all required environment variables are set
- Ensure image names are correct and accessible
- Check for port conflicts with other services
Service Communication Issues
- Verify services are on the same network
- Use service names (not container names) for communication
- Check firewall rules if accessing external services
- Verify port mappings in your compose file
Volume Mount Problems
- Ensure volume paths are correctly specified
- Check file permissions in mounted directories
- Verify volumes are created before containers start
Next Steps
Domains & Routing
Configure domains for your compose services
Templates
Explore available compose templates