dcloud deploy apps create

Create an app

IAM deploy:CreateAppChanges state

builder "image" needs imageRef; "compose" needs composeSource, composeService and composePort.

Synopsis

dcloud deploy apps create --name name [flags]

Flags

  • --nameRequired

    string

    Display name of the app

    Constraints: 1-64 chars

  • --slugOptional

    string

    Short name used in the app’s default hostname; must be unique in the organization; derived from name when omitted

    Constraints: 1-63 chars, /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/

  • --hostingOptional

    enum

    machine (default): the app runs on its own machines; pooled: a Next.js app on shared hosts that scales to zero, deployed from bundles your CI uploads

    One of: machine, pooled

  • --memory-mbOptional

    number

    Pooled hosting: memory reserved for the app’s server while it runs, in MB; default 768

    Constraints: integer, 256-2048

  • --idle-secondsOptional

    number

    Pooled hosting: seconds without a request after which the app’s server is stopped; default 300

    Constraints: integer, 60-3600

  • --databaseOptional

    enum

    Pooled hosting only: postgres gives the app a Postgres database on its pool host (needs deploy:ManageHostDatabase); none (default) gives it none. An app on its own machines is refused with 400 and binds a managed Postgres instead

    One of: none, postgres

  • --git-repository-idOptional

    string

    Git repository the app builds from; required for every builder except image and compose. The app starts with that repository’s tags

  • --branchOptional

    string

    Branch the app deploys from; omitted, the repository’s default branch (main for pooled hosting)

    Constraints: 1-255 chars

  • --deploy-on-pushOptional

    boolean (--deploy-on-push / --no-deploy-on-push)

    Deploy each commit pushed to the branch, as the person who pushed it; default true when gitRepositoryId is set (always false for pooled hosting)

  • --root-dirOptional

    string

    Directory in the repository the app is built from; default the repository root (.)

    Constraints: 1-255 chars, /^[A-Za-z0-9._/-]+$/

  • --builderOptional

    enum

    How the app is built: railpack (default) detects the stack, dockerfile uses the repository’s Dockerfile, image runs imageRef, compose runs a compose file

    One of: railpack, dockerfile, forgejo_actions, image, compose

  • --build-commandOptional

    string

    Replaces the build command the builder would detect

    Constraints: max 1024 chars

  • --start-commandOptional

    string

    Replaces the command the builder would start the app with

    Constraints: max 1024 chars

  • --image-refOptional

    string

    Container image the app runs (host/repository:tag or @sha256 digest); required when builder is image. A short Docker Hub name is stored with docker.io/ in front

    Constraints: 1-512 chars, /^[a-z0-9]([a-z0-9._-]*[a-z0-9])?(:[0-9]+)?(\/[a-z0-9]([a-z0-9._-]*[a-z0-9])?)*(:[A-Za-z0-9._-]+|@sha256:[a-f0-9]{64})?$/

  • --ecr-repository-idOptional

    string

    Repository of this organization’s registry the image comes from, so the machines get a pull credential for it; for an inline compose file it is found from the file when omitted

  • --compose-sourceOptional

    enum

    Compose apps: inline takes the file text from composeFile, git reads composePath from the connected repository

    One of: inline, git

  • --compose-fileOptional

    string

    Compose apps with composeSource inline: the compose file text, checked when saved

    Constraints: max 131072 chars

  • --compose-pathOptional

    string

    Compose apps with composeSource git: path of the compose file in the repository

    Constraints: 1-255 chars, /^[A-Za-z0-9._/-]+$/

  • --compose-serviceOptional

    string

    Compose apps: the service published on the app’s domains; required

    Constraints: 1-63 chars

  • --compose-portOptional

    number

    Compose apps: the container port of composeService that receives traffic; required

    Constraints: integer, 1-65535

  • --portOptional

    number

    Port the app listens on in its container; default 3000

    Constraints: integer, 1-65535

  • --instance-typeOptional

    string

    Machine size of each machine, an instance type, e.g. performance-2 (the provider’s own names are still accepted, deprecated); default the region’s default size

    Constraints: 1-32 chars

  • --replicasOptional

    number

    Number of machines; default 1. More than one puts a load balancer in front

    Constraints: integer, 1-10

  • --release-commandOptional

    string

    Command run once per deployment with /bin/sh -c in the new image, before traffic moves to it (e.g. database migrations); null or omitted runs none

    Constraints: 1-4096 chars

    May be null.

  • --release-serviceOptional

    string

    Compose apps: the service whose image and environment run the release command; omitted or null, the published service

    Constraints: 1-63 chars

    May be null.

  • --release-timeout-secOptional

    number

    Seconds the release command may run before the deployment fails; a new app gets 600

    Constraints: integer, 10-3600

  • --health-checkOptional

    object

    The HTTP check a new container must pass before it gets traffic; null or omitted means GET / on the app port, any status below 500

    Constraints: JSON

    May be null.

  • --compose-health-checksOptional

    map of string

    Compose apps: health checks for services other than the published one, keyed by service name

    Constraints: key=<json>

    May be null.

  • --tagsOptional

    map of string

    Tags for the app, added to those inherited from the repository

    Constraints: key=value

Example

dcloud deploy apps create --name example

Generated from the API description, the same one the API checks requests against and the CLI is built from.