Effortlessly Control Docker Services with Webhooks
detail.loadingPreview
Automate the starting and stopping of your Docker Compose services using simple HTTP requests. This workflow provides an easy way to manage your containerized applications remotely through a secure webhook interface.
About This Workflow
This n8n workflow empowers you to manage your Docker Compose services with unprecedented ease. By leveraging webhooks, you can trigger actions to start or stop specific services on your server via a simple POST request. The workflow first receives your request through a secure webhook, then determines the desired action (start or stop) and the target service. It securely connects to your server via SSH to execute the appropriate docker compose up -d or docker compose down command. Finally, it provides a clear response indicating the success or current state of your Docker service, streamlining your DevOps operations.
Key Features
- Remote Docker Control: Start and stop Docker Compose services from anywhere via HTTP requests.
- Secure SSH Integration: Utilizes secure SSH connections for executing Docker commands.
- Action-Based Routing: Dynamically handles 'start' and 'stop' actions based on webhook input.
- State Feedback: Provides clear responses on whether a service was started, stopped, or already in the desired state.
- Customizable Service Management: Easily adaptable to manage different Docker Compose services by modifying webhook parameters.
How To Use
- Webhook Setup: Configure the 'Webhook' node with your desired HTTP method (POST) and path (e.g.,
docker/:action/:service). Set up basic authentication credentials. - SSH Configuration: Add your server's SSH credentials to the 'SSH Password' credential type.
- Action Logic: The 'Action??' node directs the workflow based on the
actionparameter from the webhook. - Start Logic: If the action is 'start', the 'Start' node executes
docker compose up -dwithin the specified service directory. The 'Started?' node checks the command's output for confirmation. - Stop Logic: If the action is 'stop', the 'Stop' node executes
docker compose down. The 'Stopped?' node checks the command's output. - Respond: The 'Respond - Started', 'Respond - Started Already', 'Respond - Stopped', and 'Respond - Already Stopped' nodes provide feedback to the caller based on the execution results.
Apps Used
Workflow JSON
{
"id": "ac6b5762-b045-4c7b-aa64-659baa40da75",
"name": "Effortlessly Control Docker Services with Webhooks",
"nodes": 11,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: ac6b5762-b045...
About the Author
Crypto_Watcher
Web3 Developer
Automated trading bots and blockchain monitoring workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Robust Concurrency Control for n8n Workflows with Redis
Prevent simultaneous execution of critical n8n workflows or tasks using a centralized, Redis-backed locking mechanism. This reusable utility workflow ensures data integrity and resource management by allowing other workflows to acquire, check, and release locks.