Skip to content

dokploy_deploy_running_apps.sh

Corey Watson edited this page Dec 1, 2025 · 1 revision

dokploy_deploy_running_apps.sh

Automatically deploys all running Dokploy applications.

Overview

Automatically fetches all Dokploy applications and triggers deployments for running applications while skipping idle ones. Uses the Dokploy API to retrieve application status and initiate deployments with proper error handling.

Purpose

Automates the deployment process for all running Dokploy applications. Fetches application metadata via the Dokploy API, checks each app's status, and triggers deployments only for apps that are currently running. Idle applications are skipped to prevent unnecessary resource usage and deployment conflicts.

Prerequisites

  • curl installed
  • Network connectivity to Dokploy domain
  • Valid Dokploy API token with deployment permissions
  • Dokploy domain properly configured

Configuration

Required Inputs

  • DOKPLOY_DOMAIN: Your Dokploy domain (e.g., "app.dokploy.com")
  • API_TOKEN: API token from Dokploy profile settings

Behavior

  1. Fetches all application IDs from Dokploy via API
  2. Iterates through each application ID
  3. Retrieves application info including status, name, and project
  4. Skips applications with "idle" status
  5. Triggers deployment for applications with "running" status
  6. Displays progress and results for each application
  7. Adds 2-second delay between deployments to avoid API rate limits

Security Notes

  • API token must be kept secure and not committed to version control
  • Replace API_TOKEN placeholder before running
  • API calls use HTTPS for encrypted communication
  • No sensitive data logged to console

Exit Codes

  • 0: Success (all deployments processed)
  • 1: Failure (error occurred during execution)

Example Output

➡️  Fetching all application IDs...
✅ Found all applications. Starting status check...
------------------------------------------------
Fetching info for app: abc123def456
🟡 Skipping 'idle' app: Project: MyProject, App: MyApp (ID: abc123def456)
------------------------------------------------
Fetching info for app: xyz789ghi012
🚀 Triggering deployment for 'running' app (running): Project: WebApp, App: Frontend (ID: xyz789ghi012)
✔️  Deployment triggered for WebApp - Frontend.
------------------------------------------------
🎉 All deployments have been processed!

Version History

  • v1.0.0 (2024-11-18): Initial release with Limehawk Style A formatting

Links

Clone this wiki locally