Skip to content

feat(templates): support isolated = false opt-out in template.toml#4370

Merged
Siumauricio merged 4 commits intocanaryfrom
fix/template-isolated-deployment
May 9, 2026
Merged

feat(templates): support isolated = false opt-out in template.toml#4370
Siumauricio merged 4 commits intocanaryfrom
fix/template-isolated-deployment

Conversation

@Siumauricio
Copy link
Copy Markdown
Contributor

Summary

  • Adds isolated?: boolean field to [config] in the CompleteTemplate interface
  • When a template sets isolated = false in its template.toml, Dokploy skips isolated deployment (no network injection)
  • Default behavior is unchanged — isolated is true by default for all existing templates

This 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:

service cloudflared declares mutually exclusive network_mode and networks: invalid compose project

Closes #4366

Related: Dokploy/templates#856 (adds isolated = false to the cloudflared template)

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
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels May 9, 2026
Siumauricio and others added 3 commits May 8, 2026 19:26
…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.
@Siumauricio Siumauricio merged commit 0f526af into canary May 9, 2026
4 checks passed
@Siumauricio Siumauricio deleted the fix/template-isolated-deployment branch May 9, 2026 01:34
@dosubot
Copy link
Copy Markdown

dosubot Bot commented May 9, 2026

Documentation Updates

1 document(s) were updated by changes in this PR:

copilot-instructions
View 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").
 

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloudflared with network_mode: host cant be deployed

1 participant