Skip to content

⭐ StartDragonfly

Terrence Daniels edited this page Jul 9, 2026 · 3 revisions

StartDragonfly StartDragonfly is the provisioning action responsible for launching Dragonfly database containers with secure defaults, persistent volumes, optional TLS/SSL support, engine‑specific runtime flags, and predictable startup behavior. Dragonfly is a modern, high‑performance, Redis‑compatible in‑memory datastore designed for multi‑threaded workloads and extreme throughput.

This page explains how StartDragonfly works, what it generates, and how it fits into the broader provisioning system.

Purpose of StartDragonfly The StartDragonfly action handles all logic required to start a Dragonfly instance, including:

Validating configuration

Generating SSL certificates

Creating persistent volumes

Building environment variables

Generating Docker Compose

Applying Dragonfly‑specific runtime flags

Configuring healthchecks

Starting the container

It ensures Dragonfly is provisioned consistently and securely across all deployments.

Dragonfly‑Specific Requirements Dragonfly is Redis‑compatible but introduces several unique features:

  1. Multi‑Threaded Architecture Dragonfly is designed for multi‑core performance. It supports runtime flags such as:

Code --threads 2. Optional Password Authentication Dragonfly supports Redis‑style authentication:

Code --requirepass This is applied automatically when configured.

  1. Optional TLS/SSL Dragonfly supports TLS with flags similar to Redis/KeyDB:

Code --tls-port --tls-cert-file --tls-key-file --tls-ca-cert-file Your StartDragonfly action handles this automatically.

  1. Data Directory Dragonfly stores data in:

Code /data This directory is mapped to a persistent volume.

  1. Config File Dragonfly may require a custom config file when:

TLS is enabled

Passwords are enabled

Multi‑threading is configured

Custom runtime flags are used

StartDragonfly generates and mounts this file when needed.

StartDragonfly Lifecycle mermaid flowchart TD A[StartDragonfly] --> B[Validate Configuration] B --> C[Generate SSL Certificates] C --> D[Generate Persistent Volumes] D --> E[Build Environment Variables] E --> F[Generate Docker Compose] F --> G[Start Dragonfly Container]

  1. Validate Configuration StartDragonfly checks:

Port availability

Password (if enabled)

Volume paths

SSL/TLS settings

Multi‑threading options

Custom runtime flags

Dragonfly is flexible, but misconfiguration can break TLS or persistence.

  1. Generate SSL Certificates (Optional) If TLS is enabled:

A CA certificate is generated

A server certificate is generated

A server key is generated

Certificates are mounted into the container

Dragonfly is configured to use TLS

Certificates are stored under:

Code /data/coolify/ssl// 3. Generate Persistent Volumes Using GeneratesLocalPersistentVolumes, StartDragonfly creates:

Local data directory

SSL directory (if TLS enabled)

Config directory (if needed)

Volumes are mapped into the container:

Code /data /etc/dragonfly/ssl /etc/dragonfly/conf This ensures Dragonfly persistence across restarts.

  1. Build Environment Variables Dragonfly uses fewer environment variables than SQL engines, but StartDragonfly still builds:

Optional Code DRAGONFLY_PASSWORD System Internal variables required for provisioning.

SSL If TLS is enabled:

Code DRAGONFLY_SSL_CA DRAGONFLY_SSL_CERT DRAGONFLY_SSL_KEY 5. Generate Docker Compose StartDragonfly generates a full Compose service definition including:

Image Code dragonflydb/dragonfly: Ports Code 6379:6379 Volumes Data directory

SSL directory

Config directory

Environment Variables All normalized variables.

Healthcheck Dragonfly healthcheck typically uses:

Code dragonfly ping Runtime Options Dragonfly‑specific flags such as:

--threads

--requirepass

TLS flags

Custom config file path

  1. Start the Container The generated Compose file is passed to the provisioning engine, which:

Creates the container

Applies resource limits

Connects networks

Starts Dragonfly

Verifies healthcheck

Marks the database as running

Example Compose Snippet (Conceptual example — your implementation generates this dynamically.)

Code services: dragonfly: image: dragonflydb/dragonfly:latest ports: - "6379:6379" volumes: - /data/coolify/dragonfly//data:/data - /data/coolify/ssl/:/etc/dragonfly/ssl - /data/coolify/dragonfly//conf:/etc/dragonfly/conf command: - dragonfly - --threads=4 - --requirepass=${DRAGONFLY_PASSWORD} - --tls-port=6379 - --tls-cert-file=/etc/dragonfly/ssl/server.pem - --tls-key-file=/etc/dragonfly/ssl/server.key - --tls-ca-cert-file=/etc/dragonfly/ssl/ca.pem healthcheck: test: ["CMD", "dragonfly", "ping"] interval: 10s timeout: 5s retries: 5 Why StartDragonfly Is Important StartDragonfly ensures:

Secure defaults

Predictable provisioning

Multi‑threading support

Optional TLS/SSL

Persistent storage

Clean environment variable handling

Consistent Docker orchestration

Dragonfly is one of the fastest Redis‑compatible engines available, and StartDragonfly ensures it is provisioned reliably and securely.

Clone this wiki locally