Configuration File

Processes

The [[processes]] section is used to define the different processes that make up your application. You can define multiple processes, such as a web server or a background worker.

Each process is defined as a separate [[processes]] table.

# Configuration file with a processes section
app = 'myapp'

# App process
[[processes]]
  name = 'app'
  command = 'php artisan serve'
  size = 'small'

  [processes.http]
    internal_port = 8080

  [[processes.ports]]
    port = 9090
    protocol = 'tcp'
  [[processes.ports]]
    port = 53
    protocol = 'udp'

  [processes.autoscaling]
    min_replicas = 1
    max_replicas = 5
  [[processes.autoscaling.metrics]]
    resource = 'cpu'
    avg_utilization = 70
  [[processes.autoscaling.metrics]]
    resource = 'memory'
    avg_value = '512Mi'

  [processes.liveness]
    type = 'http'
    path = '/up'
    port = 8080
    initial_delay_seconds = 30
    timeout_seconds = 5
    period_seconds = 10
    success_threshold = 1
    failure_threshold = 3

  [processes.readiness]
    type = 'tcp'
    port = 9090
    initial_delay_seconds = 40
    timeout_seconds = 4
    period_seconds = 8
    success_threshold = 2
    failure_threshold = 4

# Worker process
[[processes]]
  name = 'worker'
  command = 'php artisan queue:work'

  [processes.resources]
    [processes.resources.requests]
      cpu = '500m'
      memory = '256Mi'
    [processes.resources.limits]
      cpu = '1'
      memory = '512Mi'

  [processes.liveness]
    type = 'exec'
    command = 'php artisan health:check'
    initial_delay_seconds = 20
    timeout_seconds = 15
    period_seconds = 30
    success_threshold = 1
    failure_threshold = 3

  [processes.readiness]
    type = 'exec'
    command = 'php artisan health:check'
    initial_delay_seconds = 22
    timeout_seconds = 18
    period_seconds = 32
    success_threshold = 2
    failure_threshold = 4

Common fields

  • name: The name of the process.
  • command: The command to execute to start the process.
  • size: The size of the process. This is a predefined set of CPU and memory resources. If you need more control, you can use the resources section instead.
SizeCPUMemory
pico250m256Mi
nano500m256Mi
micro500m512Mi
mini1000m512Mi
small1000m1Gi
medium2000m2Gi
standard2000m4Gi
large4000m8Gi
xlarge4000m12Gi
xxlarge6000m16Gi
xxxlarge8000m32Gi

processes.http

The [processes.http] section exposes the process to the internet via HTTP. Only one process can have an http section.

  • internal_port: The port that the application is listening on inside the container.

processes.ports

The [[processes.ports]] section allows you to expose additional ports for your process.

  • port: The port to expose.
  • protocol: The protocol to use (tcp or udp).

processes.autoscaling

The [processes.autoscaling] section allows you to configure autoscaling for your process.

  • min_replicas: The minimum number of replicas.
  • max_replicas: The maximum number of replicas.
  • metrics: A list of metrics to use for autoscaling. You can use cpu or memory.

processes.resources

The [processes.resources] section allows you to specify the CPU and memory resources for your process.

  • requests: The amount of resources that are guaranteed for the process.
  • limits: The maximum amount of resources that the process can use.

Health Checks

Deckrun uses liveness and readiness probes to check the health of your application.

  • liveness: If the liveness probe fails, the container is restarted.
  • readiness: If the readiness probe fails, the container is removed from the service discovery, so it doesn't receive any more traffic.

Both probes have the same configuration options:

  • type: The type of probe (http, tcp, or exec).
  • path: The path to check (for http probes).
  • port: The port to check (for http and tcp probes).
  • command: The command to execute (for exec probes).
  • initial_delay_seconds: The number of seconds to wait before starting the probe.
  • timeout_seconds: The number of seconds after which the probe times out.
  • period_seconds: How often to perform the probe.
  • success_threshold: The minimum consecutive successes for the probe to be considered successful after having failed.
  • failure_threshold: The number of times that the probe is tried before considering it failed.
Previous
Deploy