puq-docker-immich-deploy

用于PUQ Docker Immich部署,通过自动化工作流程整合Webhook、SSH和Sticky Note,简化Docker容器管理。该流程支持容器的创建、启动、停止、挂载和卸载,确保高效的资源利用和管理。用户可实时获取容器状态、日志和网络统计信息,提升操作透明度和响应速度。通过自动化设置和更新NGINX配置,确保安全性和性能优化,显著减少手动干预,提高工作效率。

7/4/2025
35 nodes
Complex
webhookcomplexrespondtowebhooksshsticky noteadvancedlogicconditionalintegrationapirouting
Categories:
Webhook TriggeredComplex Workflow
Integrations:
RespondToWebhookSshSticky Note

Target Audience

This workflow is designed for:
- Developers looking to automate Docker container management tasks.
- System Administrators who need to efficiently deploy and manage applications using Docker.
- DevOps Engineers aiming to streamline CI/CD processes with automated deployment and monitoring.
- IT Teams responsible for maintaining server infrastructure and ensuring application uptime.

Problem Solved

This workflow addresses the following challenges:
- Complexity in Docker Management: Simplifies the process of starting, stopping, and managing Docker containers through automated scripts.
- Error Handling: Provides robust error handling to ensure that any issues during deployment or management are captured and reported, reducing downtime.
- Integration with Webhooks: Facilitates real-time responses to events via webhooks, allowing for immediate action based on external triggers.
- Monitoring and Logging: Collects detailed logs and statistics from containers, enabling better insights into application performance and resource utilization.

Workflow Steps

  • Webhook Trigger: The workflow starts when a webhook receives a POST request at the specified path (docker-immich).
    2. Parameter Initialization: Sets up parameters such as server_domain, clients_dir, and mount_dir to define the environment for Docker operations.
    3. Input Validation: Checks if the provided server_domain matches expected values; if not, responds with a 422 error indicating an invalid domain.
    4. Command Routing: Based on the command received in the webhook (container_start, container_stop, etc.), the workflow directs to the appropriate action node.
    5. Container Management Actions: Executes the necessary scripts to start, stop, mount, unmount, or manage the state of Docker containers.
    6. Logging and Monitoring: Gathers logs and statistics from the containers, providing insights into their performance and health.
    7. Response to Webhook: Finally, the workflow sends a structured JSON response back to the webhook sender, indicating the success or failure of the invoked command.
  • Customization Guide

    Users can customize this workflow by:
    - Modifying Parameters: Update the server_domain, clients_dir, and mount_dir values in the Parametrs node to match their environment.
    - Adjusting Commands: Add or modify commands in the Container Actions and Service Actions nodes to include additional Docker operations specific to their needs.
    - Enhancing Error Handling: Customize error messages and handling logic in the script nodes to fit their operational requirements.
    - Expanding Functionality: Integrate additional nodes for monitoring, alerting, or interacting with other services as needed, leveraging the flexibility of n8n's node-based architecture.