-
Notifications
You must be signed in to change notification settings - Fork 0
⭐ Docker Orchestration
Docker Orchestration is the subsystem responsible for generating, managing, and executing Docker Compose configurations for all database engines. It acts as the execution layer beneath StartActions, transforming engine‑specific provisioning logic into runnable container definitions with predictable behavior, secure defaults, and consistent resource handling.
This page explains how Docker Orchestration works, how Compose files are generated, how containers are started, and how orchestration integrates with the rest of the platform.
Purpose of Docker Orchestration The Docker Orchestration subsystem provides:
Deterministic container startup
Engine‑specific Compose generation
Secure volume mounting
Network configuration
Healthcheck integration
Resource limit enforcement
TLS/SSL mounting
Environment variable injection
It ensures every database engine is launched in a consistent, reproducible manner.
How Docker Orchestration Fits Into the System StartActions generate:
Environment variables
Volume definitions
SSL directories
Config directories
Runtime flags
Healthchecks
Docker Orchestration takes these components and produces:
A complete Docker Compose service
A runnable container
A predictable startup lifecycle
Orchestration Workflow mermaid flowchart TD A[StartAction] --> B[Generate Compose] B --> C[Provisioning Engine] C --> D[Create Volumes] D --> E[Create Container] E --> F[Start Container] F --> G[Run Healthcheck] G --> H[Mark Database Running]
- Compose Generation Each StartAction produces a structured Compose definition containing:
Image Engine‑specific image:
mysql:
postgres:
redis:
eqalpha/keydb:
dragonflydb/dragonfly:
mongo:
Ports Mapped from the database configuration:
Code 3306:3306 (MySQL/MariaDB) 5432:5432 (PostgreSQL) 6379:6379 (Redis/KeyDB/Dragonfly) 27017:27017 (MongoDB) Volumes Persistent directories:
Data directory
SSL directory
Config directory
Keyfile directory (MongoDB)
Environment Variables Normalized by the StartAction.
Persistent directories:
Data directory
SSL directory
Config directory
Keyfile directory (MongoDB)
Environment Variables Normalized by the StartAction.
Healthcheck Engine‑specific commands:
mysqladmin ping
pg_isready
redis-cli ping
keydb-cli ping
dragonfly ping
mongo --eval "db.adminCommand('ping')"
Runtime Flags Engine‑specific options:
MySQL authentication plugin
PostgreSQL TLS settings
Redis/KeyDB/Dragonfly TLS flags
MongoDB keyfile + TLS flags
- Provisioning Engine The provisioning engine receives the Compose definition and:
Creates volumes
Writes config files
Writes SSL certificates
Writes keyfiles (MongoDB)
Prepares directories
Normalizes permissions
This ensures the container has everything it needs before startup.
- Container Creation Docker Orchestration uses the Compose definition to:
Create the container
Attach networks
Mount volumes
Inject environment variables
Apply runtime flags
This step ensures the container is fully configured before running.
- Container Startup The container is started with:
Engine‑specific runtime flags
TLS configuration
Authentication configuration
Config file paths
Volume mounts
Startup behavior is deterministic across all engines.
- Healthcheck Execution After startup, the healthcheck runs until the engine reports readiness.
Examples:
Code mysqladmin ping -h localhost pg_isready -U postgres redis-cli ping keydb-cli ping dragonfly ping mongo --eval "db.adminCommand('ping')" If the healthcheck fails repeatedly, the provisioning engine marks the database as failed.
- Database Ready State Once the healthcheck passes:
The database is marked as running
Connection details are stored
SSL paths are stored
Environment variables are finalized
The instance is now ready for client connections.
Example Compose Snippet (Conceptual) services: mysql: image: mysql:8.0 ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" volumes: - /data/coolify/mysql//data:/var/lib/mysql - /data/coolify/ssl/:/etc/mysql/ssl healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] interval: 10s timeout: 5s retries: 5
Why Docker Orchestration Matters Docker Orchestration ensures:
Predictable container startup
Secure mounting of sensitive files
Consistent behavior across engines
Automatic TLS integration
Automatic healthchecks
Reproducible deployments
Clean separation between provisioning logic and execution logic
It is the backbone of the entire database provisioning system.