{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "title": "PortainerAppTemplateV3", "properties": { "version": { "type": "string", "const": "3", "description": "The version of the Portainer App Template." }, "templates": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "minimum": 1, "description": "Unique identifier for the template." }, "type": { "type": "integer", "minimum": 1, "maximum": 4, "description": "The type of the application (1=container, 2=swarm stack, 3=compose stack, 4=compose edge stack)." }, "title": { "type": "string", "minLength": 1, "description": "The title of the application." }, "description": { "type": "string", "minLength": 1, "description": "A brief description of the application." }, "categories": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "An array of categories the application belongs to." }, "platform": { "type": "string", "enum": ["linux", "windows"], "description": "The target platform of the application; omit for multi-platform." }, "logo": { "type": "string", "format": "uri", "description": "A URI to the logo of the application." }, "image": { "type": "string", "minLength": 1, "description": "The name of the Docker image used for the application." }, "restart_policy": { "type": "string", "enum": ["always", "unless-stopped", "on-failure", "no"], "description": "The restart policy for the application." }, "ports": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "An array of port mappings for the application." }, "volumes": { "type": "array", "items": { "type": "object", "properties": { "container": { "type": "string", "minLength": 1, "description": "The container path for the volume binding." }, "bind": { "type": "string", "description": "The host path for the volume binding." }, "readonly": { "type": "boolean", "description": "Whether the volume is read-only." } }, "additionalProperties": false, "required": ["container"] }, "description": "An array of volume mappings for the application." }, "env": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The name of the environment variable." }, "label": { "type": "string", "description": "Display label for the environment variable." }, "description": { "type": "string", "description": "Description of the environment variable." }, "default": { "type": "string", "description": "The default value for the environment variable." }, "preset": { "type": "boolean", "description": "When true, the variable is applied silently with its default value." }, "select": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" }, "value": { "type": "string" }, "default": { "type": "boolean" } }, "additionalProperties": false, "required": ["text", "value"] }, "description": "Dropdown options for the environment variable." } }, "additionalProperties": false, "required": ["name"] }, "description": "Environment variables for the template." }, "labels": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "value": { "type": "string", "minLength": 1 } }, "additionalProperties": false, "required": ["name", "value"] }, "description": "Docker labels for the template." }, "repository": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "URL of the git repository." }, "stackfile": { "type": "string", "minLength": 1, "description": "Path to the stack file within the repository." } }, "additionalProperties": false, "required": ["url", "stackfile"], "description": "Repository details for stack templates (types 2 and 3)." }, "note": { "type": "string", "description": "Usage or deployment notes (supports HTML)." }, "name": { "type": "string", "description": "Default name for the stack/container." }, "administrator_only": { "type": "boolean", "description": "Whether the template is only available to administrators." }, "registry": { "type": "string", "description": "Registry to pull the image from." }, "command": { "type": "string", "description": "Command to run in the container." }, "network": { "type": "string", "description": "Network to attach the container to." }, "privileged": { "type": "boolean", "description": "Whether to run the container in privileged mode." }, "interactive": { "type": "boolean", "description": "Whether the container requires an interactive shell." }, "hostname": { "type": "string", "description": "Hostname for the container." }, "stackFile": { "type": "string", "description": "Inline stack file content. When present, Portainer uses this directly instead of cloning the repository." }, "maintainer": { "type": "string", "description": "Maintainer of the template (metadata added by this repo; ignored by Portainer)." } }, "additionalProperties": false, "required": ["id", "type", "title", "description"], "allOf": [ { "if": { "properties": { "type": { "const": 1 } } }, "then": { "required": ["image"] } }, { "if": { "properties": { "type": { "const": 2 } } }, "then": { "required": ["repository"] } }, { "if": { "properties": { "type": { "const": 3 } } }, "then": { "required": ["repository"] } }, { "if": { "properties": { "type": { "const": 4 } } }, "then": { "anyOf": [{ "required": ["stackFile"] }, { "required": ["repository"] }] } } ] } } }, "additionalProperties": false, "required": ["version", "templates"] }