Skip to content
Skip to content

Deployment Pipeline

Every doku deploy command triggers a multi-stage pipeline that builds, provisions, deploys, and verifies your application automatically.

Pipeline Stages

Build

Doku runs your build command, packages the output into a container image, and pushes it to a managed registry. Build caching is enabled by default — only changed layers are rebuilt.

bash
doku deploy --env staging

# [build] Running: npm run build
# [build] Build completed in 23s
# [build] Image pushed: registry.doku.io/acme-web:v42-abc1234

Provision

On first deploy, Doku provisions all required infrastructure (VPC, load balancers, container service, DNS). On subsequent deploys, only changed resources are updated. Infrastructure state is managed by Terraform under the hood.

Deploy

New container tasks are launched alongside the existing version. Doku waits for health checks to pass before routing any traffic to the new version.

Canary Rollout

Traffic is shifted in steps defined in your doku.yaml. At each step, Doku evaluates error rates, P99 latency, and CPU/memory utilization. The rollout advances only if all metrics are within thresholds.

bash
# [canary] Step 1/4: routing 10% traffic → v42
# [canary] Metrics OK after 60s (errors: 0.02%, p99: 180ms)
# [canary] Step 2/4: routing 25% traffic → v42
# [canary] Metrics OK after 60s (errors: 0.03%, p99: 195ms)
# [canary] Step 3/4: routing 50% traffic → v42
# [canary] Step 4/4: routing 100% traffic → v42
# [canary] ✓ Deployment complete

Skipping canary

You can skip the canary phase with doku deploy --skip-canary, but this is not recommended for production environments. All traffic shifts to the new version immediately.

Verification

After the canary completes, Doku continues monitoring for a cooldown period (default: 5 minutes). If issues are detected during cooldown, an automatic rollback is triggered.

Deploying to Different Environments

Use the --env flag to target a specific environment:

bash
# Deploy to staging (default)
doku deploy

# Deploy to production
doku deploy --env production

Each environment has isolated infrastructure, environment variables, and scaling configuration. See Environments for details.

Dry Run

Preview what a deployment will do without making any changes:

bash
doku deploy --dry-run --env production

The dry run shows infrastructure changes, container image details, and the canary rollout plan.

Deployment Pipeline — Doku Docs — Doku