feat(templates): support isolated = false opt-out in template.toml#4370
Merged
Siumauricio merged 4 commits intocanaryfrom May 9, 2026
Merged
feat(templates): support isolated = false opt-out in template.toml#4370Siumauricio merged 4 commits intocanaryfrom
Siumauricio merged 4 commits intocanaryfrom
Conversation
Templates using network_mode: host (e.g. cloudflared) can now declare isolated = false in their [config] section to prevent Dokploy from injecting networks into the compose, which would cause a Docker error. Default behavior (isolated = true) is unchanged for all existing templates. Fixes #4366
…plate Introduced an optional 'isolated' boolean property in the CompleteTemplate interface to manage isolated deployment settings. Added tests to verify default behavior (isolated=true) and explicit settings (isolated=true/false) in the deployment configuration. This change enhances template flexibility for deployment configurations.
|
Documentation Updates 1 document(s) were updated by changes in this PR: copilot-instructionsView Changes@@ -51,6 +51,7 @@
- **Template IDs**: Lowercase, kebab-case (e.g., `active-pieces`); unique across repo—enforced by dedupe script.
- **Docker Compose**: Minimal—omit `ports` (Dokploy proxies), persistent volumes (e.g., `- db-data:/var/lib/postgresql/data`). Services named after folder (e.g., `ghost` service).
- **template.toml**:
+ - Config: `[config] isolated = false` (optional, boolean, default: true)—set to `false` to opt out of Dokploy's isolated deployment and network injection. Use when your template requires `network_mode: host` or other network configurations that are mutually exclusive with Docker networks. When `isolated = false`, Dokploy will not inject its network configuration into the compose file.
- Variables: `[variables] main_domain = "${domain}"`; use helpers for secrets (`${password:64}`, `${base64:32}`).
- Domains: `[[config.domains]] serviceName = "<service>" port = 80 host = "${main_domain}"` (path="/" optional).
- Env: `[[config.env]]` array of "KEY=VALUE" strings, interpolating vars (e.g., "DB_PASSWORD=${db_pass}").
@@ -58,7 +59,7 @@
- Mounts: `[[config.mounts]] filePath = "/etc/config" content = """multi-line\ncontent"""`.
- JWT helper: `${jwt:secret_var:payload_var}` for auth tokens; payload as JSON string with `exp: ${timestamps:YYYY-MM-DDTHH:mm:ssZ}`.
- **Meta.json**: Entries as JSON objects; tags array of lowercase strings (e.g., ["monitoring", "database"]); links object with `github`, `website`, `docs`.
-- **No Networks**: Rely on Dokploy's isolated deployments—avoid explicit `networks:`.
+- **No Networks**: Dokploy uses isolated deployments by default—avoid explicit `networks:` in compose files. Templates can set `isolated = false` in `template.toml` `[config]` section if they require `network_mode: host` or similar configurations that are mutually exclusive with Docker networks.
- **Versions**: Pin images to specific versions in `docker-compose.yml` (e.g., `ghost:5.82.0-alpine`); match in `meta.json.version`. **NEVER use `latest` tag**—it can break templates when upstream images change unexpectedly. **Always verify image exists** using `docker manifest inspect <image:tag>` before committing.
- **Logos**: SVG preferred; size ~128x128; file name in `meta.json.logo` (e.g., "ghost.svg").
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isolated?: booleanfield to[config]in theCompleteTemplateinterfaceisolated = falsein itstemplate.toml, Dokploy skips isolated deployment (no network injection)isolatedistrueby default for all existing templatesThis fixes deployments of templates like cloudflared that use
network_mode: host, which is mutually exclusive with Docker networks. Without this, Dokploy's network injection causes:Closes #4366
Related: Dokploy/templates#856 (adds
isolated = falseto the cloudflared template)