Files
terraform-provider-dokploy/docs/resources/postgres.md
Max Vojtkov a6d8aa8b52 A Terraform provider for Dokploy
Plugin-framework provider covering projects, environments, applications,
Compose stacks, managed databases, domains, mounts, ports, redirects,
basic auth, registries, SSH keys, certificates and backup destinations,
over Dokploy's tRPC-over-REST API.

The shim package exposes the provider to other Go modules, which is how
pulumi-dokploy bridges it.
2026-08-09 12:17:26 +03:00

3.4 KiB

page_title, subcategory, description
page_title subcategory description
dokploy_postgres Resource - dokploy A managed PostgreSQL instance running on Dokploy. ~> Creating this resource provisions the service definition but does not start a deployment. Deploy it from the Dokploy UI or CLI. ~> Credentials are stored in Terraform state. Use a state backend with encryption at rest.

dokploy_postgres (Resource)

A managed PostgreSQL instance running on Dokploy.

~> Creating this resource provisions the service definition but does not start a deployment. Deploy it from the Dokploy UI or CLI.

~> Credentials are stored in Terraform state. Use a state backend with encryption at rest.

Schema

Required

  • database_name (String) Name of the database to create.
  • database_password (String, Sensitive) Password for the database user.
  • database_user (String) Database user to create.
  • docker_image (String) PostgreSQL image to run, for example postgres:16.
  • environment_id (String) Environment this database belongs to.
  • name (String) Display name of the database.

Optional

  • app_name (String) Unique Docker service name. Generated by Dokploy when omitted. Changing it forces a new database.
  • args (List of String) Arguments appended to the container command.
  • command (String) Override the container entrypoint command.
  • cpu_limit (String) Hard CPU limit, for example 1.
  • cpu_reservation (String) Soft CPU reservation, for example 0.5.
  • description (String) Free-form description.
  • detach_dokploy_network (Boolean) Detach the service from the shared dokploy-network.
  • endpoint_spec_swarm (String) Docker Swarm endpoint specification, as a JSON object.
  • env (String) Environment variables in KEY=value format, one per line.
  • external_port (Number) Host port to expose the database on. Leave unset to keep the database reachable only from inside the Docker network.
  • health_check_swarm (String) Docker Swarm health check configuration, as a JSON object.
  • labels_swarm (String) Docker Swarm service labels, as a JSON object.
  • memory_limit (String) Hard memory limit, for example 512m.
  • memory_reservation (String) Soft memory reservation, for example 256m.
  • mode_swarm (String) Docker Swarm service mode, as a JSON object.
  • network_ids (List of String) IDs of additional Docker networks to attach.
  • network_swarm (String) Docker Swarm network attachments, as a JSON array.
  • placement_swarm (String) Docker Swarm placement constraints, as a JSON object.
  • replicas (Number) Number of replicas to run.
  • restart_policy_swarm (String) Docker Swarm restart policy, as a JSON object.
  • rollback_config_swarm (String) Docker Swarm rollback configuration, as a JSON object.
  • server_id (String) Remote server to deploy on. Omit to use the Dokploy host itself.
  • stop_grace_period_swarm (Number) Grace period in nanoseconds before a container is killed.
  • ulimits_swarm (String) Docker Swarm ulimits, as a JSON object.
  • update_config_swarm (String) Docker Swarm rolling update configuration, as a JSON object.

Read-Only

  • application_status (String) Current status reported by Dokploy: idle, running, done or error.
  • created_at (String) RFC 3339 timestamp of when the database was created.
  • id (String) Unique postgres identifier.