dokploy_patch (Resource)
A file change that Dokploy applies to the repository of an application or a compose service before each build: it creates, replaces, or deletes one file. A change applies at the next deploy.
~> Each file path can have one patch for each service.
Example Usage
# Replace a file in the repository of an application before each build.
resource "dokploy_patch" "config" {
application_id = dokploy_application.web.id
file_path = "config/app.yaml"
content = file("${path.module}/app.yaml")
}
# Remove a file from the repository of a compose service before each build.
resource "dokploy_patch" "no_override" {
compose_id = dokploy_compose.stack.id
file_path = "docker-compose.override.yml"
type = "delete"
}Schema
Required
file_path(String) Path of the file, relative to the repository root, for exampleconfig/app.yaml.
Optional
application_id(String) Id of the application whose repository the patch changes. Set exactly one ofapplication_idorcompose_id. A change replaces the patch.compose_id(String) Id of the compose service whose repository the patch changes. Set exactly one ofapplication_idorcompose_id. A change replaces the patch.content(String) Full content of the file. Defaults to"", the value for adeletepatch. Dokploy adds a final newline to a non-empty content when it updates the patch.enabled(Boolean) Apply the patch at the next build. Defaults totrue.type(String) What the patch does to the file:createadds it,updatereplaces its content, anddeleteremoves it. Defaults toupdate.
Read-Only
created_at(String) Creation timestamp from the server.id(String) Patch id.
Import
Import is supported using the following syntax:
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
import {
to = dokploy_patch.config
id = "5lKDN_oX5hVG5balpQIKv"
}The terraform import command can be used, for example:
terraform import dokploy_patch.config 5lKDN_oX5hVG5balpQIKv