wtree Cloud

Advanced settings

Reference for the advanced settings in Settings: run commands, Swarm, build server, resources, mounts, redirects, auth, ports and Traefik.

These settings are for complex setups and debugging. Run command, cluster settings, Swarm settings and resources are in Settings › Resources. The build server is in Settings › Source and build. Volumes and mounts are in Settings › Storage. Redirects, security, ports and Traefik are in Settings › Networking. Wrong values can break the application, and Swarm settings can disrupt orchestration, so change them deliberately. Click Redeploy after changing cluster settings or resources.

Run command

In Settings › Resources, runs a shell command in the container once the app is built and running. Enter it and click Save. Useful for debugging and admin tasks.

Cluster settings

SettingWhat it does
ReplicasNumber of instances of the application
RegistryRegistry that images are pulled from

Swarm settings

Click Swarm settings in the Cluster settings card. Each setting takes JSON, as in the zero-downtime example.

SettingFields
Health checkTest command, interval, timeout, start period, retries
Restart policyCondition, delay, max attempts, window
Update configParallelism, delay, failure action, monitor, max failure ratio, order
Rollback configParallelism, delay, FailureAction, monitor, MaxFailureRatio, order
PlacementConstraints (rules a node must meet), preferences (spread load across nodes)
ModeReplicated with Replicas; Global (one per node); ReplicatedJob with MaxConcurrent and TotalCompletions
NetworkTarget (network name), Aliases, DriverOpts such as MTU size and host binding
LabelsKey-value metadata, for example com.example.app.name = my-app

Build server

In Settings › Source and build, build on an external server, push to a registry, and have deployment servers pull the image. Use it to keep deployment servers small, build once and deploy to many, or isolate builds from production.

  1. wtree Cloud connects to the build server over SSH, clones the repository and builds the image.
  2. It pushes the image to your registry.
  3. Deployment servers pull the image and deploy it.

A build server needs a registry reachable from your deployment servers. It works for applications only, not Compose. Setup is in Build server.

Resources

wtree Cloud passes these values straight to the Docker API, so enter raw numbers without units.

SettingUnitExamples
Memory limitBytes. The container is killed above it.268435456 = 256 MB, 536870912 = 512 MB, 1073741824 = 1 GB, 2147483648 = 2 GB
Memory reservationBytes. Guaranteed minimum.134217728 = 128 MB, 268435456 = 256 MB, 536870912 = 512 MB
CPU limitnanoCPUs. Hard limit. 1000000000 = 1 core.500000000 = 0.5, 1000000000 = 1, 2000000000 = 2, 4000000000 = 4
CPU reservationnanoCPUs. Guaranteed minimum.250000000 = 0.25, 500000000 = 0.5, 1000000000 = 1

Keep each reservation at or below its limit. A memory reservation above the limit is capped to the limit, and a CPU reservation that is too high can stop the container from starting.

Units are not parsed. 1024m is read as 1024 bytes and 1.5 CPUs as 1 nanoCPU. Both are below Docker's minimums (about 6 MB, 0.001 CPU) and the deployment fails with a generic Swarm error.

wtree Cloud sends them in the service spec under TaskTemplate.Resources:

{
  "TaskTemplate": {
    "Resources": {
      "Limits": { "NanoCPUs": 2000000000, "MemoryBytes": 1073741824 },
      "Reservations": { "NanoCPUs": 1000000000, "MemoryBytes": 536870912 }
    }
  }
}

See the Docker Engine API for the full schema.

Volumes and mounts

In Settings › Storage, keep data across restarts and deployments.

TypeFieldsUse it for
Bind mountHost path, Mount path (in the container)Host files or directories, such as configs
Volume mountVolume name, Mount path (in the container)Docker-managed volumes, easier to back up and move
File mountContent, File path, Mount path (in the container)A single config file

For a file mount, the mount path must include the file name.

wtree Cloud creates a file mount once, stores it in a files folder in the project directory, and keeps it across deployments. If your app writes to the file, the editor reads the current file from the server (over SSH for remote servers), so you see those changes. If the file is missing or unreadable, the editor shows the content stored in wtree Cloud.

If the file changes on the server after you open the editor, saving is refused so your edit doesn't overwrite it. Reopen the editor and edit again.

File mount configuration File mount editor

Redirects

In Settings › Networking, click Add redirect.

FieldWhat it does
RegexMatches the URLs to redirect
ReplacementTarget URL
PermanentSends HTTP 301 instead of a temporary redirect

To send http://localhost traffic to http://mydomain, use Regex http://localhost/(.*) and Replacement http://mydomain/$1.

Security

In Settings › Networking, click Add security and set a Username and Password to put basic authentication in front of the app.

Ports

In Settings › Networking, use the Ports card.

FieldWhat it does
Published portPort on the host that routes to the app
Target portPort the app listens on in the container
ProtocolTCP or UDP

Published ports are for reaching the app at your-ip:port, not through a domain. Avoid ports already used on the host to prevent bind errors. For domains, see Domains.

Traefik

In Settings › Networking, edit Traefik rules for routing, load balancing and TLS for this application. See Web server.

On this page