Skip to content

CLI: Serverless Containers

Deploy and manage serverless containers using the DanubeData CLI.

Prerequisites

Quick start

Deploy a serverless container from a Docker image:

Bash
danube rapids create --name my-api --type docker_image --image node --tag 20-alpine --port 3000

Or deploy from a local directory:

Bash
danube rapids create --name my-api --type zip_upload --source-type dockerfile
danube rapids deploy my-api --dir ./

Listing containers

Bash
danube rapids ls

Shows all containers with name, status, resource profile, URL, and creation date.

Creating a container

Bash
danube rapids create

Without flags, the CLI guides you through interactive prompts. You can also pass flags for non-interactive creation.

From a Docker image

Bash
danube rapids create \
  --name my-api \
  --type docker_image \
  --image node \
  --tag 20-alpine \
  --profile small \
  --port 3000

From a Git repository

Bash
danube rapids create \
  --name my-api \
  --type git_repository \
  --repo https://github.com/username/my-api \
  --source-type dockerfile \
  --profile small \
  --port 8080

Build methods:

  • dockerfile — Uses your project's Dockerfile
  • buildpack — Auto-detects runtime (Node.js, Python, Go, Java, Ruby, PHP, .NET, Rust)

From a local directory (ZIP upload)

Bash
danube rapids create \
  --name my-api \
  --type zip_upload \
  --source-type buildpack \
  --profile small \
  --port 3000

Then deploy your code:

Bash
danube rapids deploy my-api --dir ./

Resource profiles

ProfilevCPUMemory
free0.01-0.164-128 MB
micro0.1-1256-512 MB
small0.5-1256-512 MB
medium1-2512 MB-1 GB
large2-41-2 GB

Billing is pay-per-use, with a free tier of 2 million requests per month.

Deploying code

Deploy from a local directory to an existing container:

Bash
danube rapids deploy my-api

Deploy a specific directory:

Bash
danube rapids deploy my-api --dir ./app

Deploy without waiting for the build to complete:

Bash
danube rapids deploy my-api --no-wait

The CLI packages your files into a ZIP, uploads them, and polls the build status every 2 seconds (timeout: 10 minutes).

Container resolution

You can reference containers by name, slug, ID, or ID prefix:

Bash
danube rapids deploy my-api          # by name
danube rapids deploy 42              # by ID
danube rapids deploy a1b2            # by ID prefix

Viewing container details

Bash
danube rapids show my-api

Displays:

  • ID, status, and deployment type
  • Image and port
  • Resource profile and monthly cost
  • Scaling configuration (min/max replicas, metric, targets)
  • Environment variables (values masked)

Updating a container

Update any configuration without redeploying:

Bash
# Change resource profile
danube rapids update my-api --profile medium

# Update scaling
danube rapids update my-api --min-scale 1 --max-scale 20

# Change scaling metric
danube rapids update my-api --scaling-metric concurrency --concurrency-target 50

# Set request timeout (max 3600 seconds)
danube rapids update my-api --timeout 300

# Update Docker image
danube rapids update my-api --image node --tag 22-alpine

# Add/update environment variables
danube rapids update my-api --env DATABASE_URL=postgres://... --env API_KEY=secret

# Remove environment variables
danube rapids update my-api --rm-env OLD_KEY UNUSED_KEY

# Combine multiple updates
danube rapids update my-api \
  --profile large \
  --min-scale 2 \
  --max-scale 50 \
  --env NODE_ENV=production

--env and --rm-env merge into the container's current variables. On a container with a connected database, cache or queue, the API only accepts the merged variables together with the container's environment_snapshot. CLI 1.8.1 and later send it for you and retry once if the variables changed meanwhile; earlier versions fail with HTTP 422 on such containers (change the variables in the console, or upgrade the CLI).

update returns as soon as the change is accepted. To block until that change has been rolled out (CLI 1.3.0 and later):

Bash
danube rapids update my-api --tag "$SHA" --wait --wait-timeout 10m

--wait exits non-zero only when the rollout settled as failed; a timeout means it is still in progress. Changes sent while a rollout is running are queued behind it, never dropped — send each change once, in a single update, rather than as several quick calls. See Rapids automation for what the wait checks.

Scaling options

FlagDescriptionDefault
--min-scale <n>Minimum replicas (0 = scale-to-zero)0
--max-scale <n>Maximum replicas10
--scaling-metric <metric>rps or concurrencyrps
--scaling-target <n>Target requests per second per pod100
--concurrency-target <n>Target concurrent requests per pod100
--timeout <seconds>Request timeout (max 3600)300

Deleting a container

Bash
danube rapids rm my-api

Prompts for confirmation. Use -y to skip:

Bash
danube rapids rm my-api -y

Deployment history

Bash
danube rapids deployments my-api

Shows all deployments with revision number, status, image:tag, traffic percentage, and deployment date.

Usage and billing

Bash
danube rapids usage my-api

Displays:

  • Total requests
  • Total compute seconds
  • Monthly cost

Filter by billing period:

Bash
danube rapids usage my-api --period 2026-01

Complete workflow example

Bash
# Install the CLI
npm install -g @danubedata/cli

# Authenticate
danube login

# Create a container from a Docker image
danube rapids create \
  --name my-api \
  --type docker_image \
  --image myorg/my-api \
  --tag v1.0.0 \
  --profile small \
  --port 8080

# View the container
danube rapids show my-api

# Update environment variables
danube rapids update my-api \
  --env DATABASE_URL=postgres://db.example.com/mydb \
  --env API_KEY=sk-abc123

# Scale up for production
danube rapids update my-api \
  --profile medium \
  --min-scale 1 \
  --max-scale 20

# Check usage
danube rapids usage my-api

# View deployment history
danube rapids deployments my-api

Next steps


Questions? Contact support at support@danubedata.ro