跳至主要内容

Create container stack

POST 

/api/v1/orgs/{orgId}/stack-configs

Overview: Creates a new container stack configuration with automatic version assignment.

• Stack name must be unique and cannot duplicate the name of any existing stack config.

• ComposeFileContent: Must be valid Base64 encoded Docker Compose content

• Environment: Optional key-value pairs that can be referenced in Docker Compose files using ${VARIABLE_NAME} syntax. Pass null or omit to skip.

• Stack Naming Rules: Must follow Docker container naming rules:

  1. Stack name may contain lowercase letters, digits and hyphen (-)

  2. Stack name may not start or end with a hyphen (-)

  3. Stack name cannot contain consecutive hyphens (-)

  4. Maximum length of 63 characters

Request body example:

{
"stackName": "my-nginx",
"type": "compose",
"composeFileContent": "dmVyc2lvbjogIjMuOCIKc2VydmljZXM6...",
"environment": {
"NGINX_PORT": "8080",
"APP_ENV": "production",
"REPLICAS": "3"
},
"description": "Production nginx stack"
}

Request

Responses

Created