Skip to content

Module Description

SAAS Website Plans - Docker Extension. Adds Docker image configuration to website subscription plans, enabling plan purchases to be deployed as Docker containers.

Dependencies

  • sadeem_subscription_website
  • sadeem_saas_docker

Extension

This module extends website subscription plans with a Docker Image field and adds a workers add-on type. When the subscription type is set to docker, the system uses the Docker image to auto-select the best Portainer environment and deploy a container.

Additional Plan Fields

  1. Subscription Type - Extended with Docker option
  2. Docker Image - Portainer image for subscriptions (required when type is docker)

Additional Add-on Type

  1. Workers - New add-on type for configuring Docker worker count

How It Works

  1. Plan is configured with type Docker and a Docker image
  2. Optionally add a workers add-on to allow customers to configure worker count
  3. Customer purchases the plan through the website flow
  4. After payment, get_best_environment() selects the optimal Portainer environment
  5. Worker count is mapped from the workers add-on quantity
  6. All environment-related fields (IP, ports, domain, Cloudflare, Nginx) are set from the environment
  7. Subscription is created and a Docker stack is deployed in Portainer

Publishing Validation

When publishing a Docker plan, the system validates that a Docker Image is configured.