LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • wheels generate app
        • wheels generate app-wizard
        • wheels generate controller
        • wheels generate model
        • wheels generate view
        • wheels generate property
        • wheels generate route
        • wheels generate resource
        • wheels generate api-resource
        • wheels generate frontend
        • wheels generate test
        • wheels generate snippets
        • wheels scaffold
      • Database Commands
        • wheels dbmigrate info
        • wheels dbmigrate latest
        • wheels dbmigrate up
        • wheels dbmigrate down
        • wheels dbmigrate reset
        • wheels dbmigrate exec
        • wheels dbmigrate create blank
        • wheels dbmigrate create table
        • wheels dbmigrate create column
        • wheels dbmigrate remove table
        • wheels db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • wheels deploy
        • wheels deploy audit
        • wheels deploy exec
        • wheels deploy hooks
        • wheels deploy init
        • wheels deploy lock
        • wheels deploy logs
        • wheels deploy proxy
        • wheels deploy push
        • wheels deploy rollback
        • wheels deploy secrets
        • wheels deploy setup
        • wheels deploy status
        • wheels deploy stop
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Synopsis
  • Description
  • Arguments
  • Options
  • Examples
  • Deploy locally
  • Deploy to Docker Swarm
  • Deploy to Kubernetes
  • Deploy to AWS ECS
  • Dry run deployment
  • Deploy with resource limits
  • What It Does
  • Deployment Targets
  • Local
  • Docker Swarm
  • Kubernetes
  • AWS ECS
  • Google Cloud Run
  • Azure Container Instances
  • Configuration Files
  • Kubernetes Example (k8s.yml)
  • Docker Swarm Example (swarm.yml)
  • Environment Management
  • Health Checks
  • Rollback
  • Use Cases
  • Notes
  • Troubleshooting
  • See Also

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Docker Commands

wheels docker deploy

Deploy your Wheels application using Docker containers.

Synopsis

wheels docker deploy [target] [options]

Description

The wheels docker deploy command deploys your containerized Wheels application to various Docker environments including Docker Swarm, Kubernetes, or cloud container services.

Arguments

Argument
Description
Default

target

Deployment target (local, swarm, kubernetes, ecs, gcp, azure)

local

Options

Option
Description
Default

--tag

Docker image tag

latest

--registry

Docker registry URL

Docker Hub

--namespace

Kubernetes namespace or project name

default

--replicas

Number of replicas

1

--cpu

CPU limit (e.g., "0.5", "2")

Platform default

--memory

Memory limit (e.g., "512Mi", "2Gi")

Platform default

--env-file

Environment file path

.env

--config-file

Deployment configuration file

Auto-detect

--dry-run

Preview deployment without applying

false

--force

Force deployment even if up-to-date

false

--help

Show help information

Examples

Deploy locally

wheels docker deploy local

Deploy to Docker Swarm

wheels docker deploy swarm --replicas=3

Deploy to Kubernetes

wheels docker deploy kubernetes --namespace=production --tag=v1.2.3

Deploy to AWS ECS

wheels docker deploy ecs --registry=123456789.dkr.ecr.us-east-1.amazonaws.com

Dry run deployment

wheels docker deploy kubernetes --dry-run

Deploy with resource limits

wheels docker deploy swarm --cpu=2 --memory=4Gi --replicas=5

What It Does

  1. Build and Tag:

    • Builds Docker image if needed

    • Tags with specified version

    • Validates image integrity

  2. Push to Registry:

    • Authenticates with registry

    • Pushes image to registry

    • Verifies push success

  3. Deploy to Target:

    • Generates deployment manifests

    • Applies configuration

    • Monitors deployment status

    • Performs health checks

  4. Post-Deployment:

    • Runs database migrations

    • Clears caches

    • Sends notifications

Deployment Targets

Local

  • Uses docker-compose

  • Development/testing

  • No registry required

Docker Swarm

  • Creates/updates services

  • Load balancing

  • Rolling updates

  • Secrets management

Kubernetes

  • Creates deployments, services, ingress

  • ConfigMaps and Secrets

  • Horizontal pod autoscaling

  • Rolling updates

AWS ECS

  • Task definitions

  • Service updates

  • Load balancer configuration

  • Auto-scaling

Google Cloud Run

  • Serverless containers

  • Automatic scaling

  • HTTPS endpoints

Azure Container Instances

  • Container groups

  • Managed instances

  • Integration with Azure services

Configuration Files

Kubernetes Example (k8s.yml)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: wheels-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: wheels
  template:
    metadata:
      labels:
        app: wheels
    spec:
      containers:
      - name: app
        image: myregistry/wheels-app:latest
        ports:
        - containerPort: 8080
        env:
        - name: WHEELS_ENV
          value: production

Docker Swarm Example (swarm.yml)

version: '3.8'
services:
  app:
    image: myregistry/wheels-app:latest
    deploy:
      replicas: 3
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
    ports:
      - "80:8080"
    secrets:
      - db_password

Environment Management

Environment variables can be provided via:

  1. --env-file option

  2. Platform-specific secrets

  3. Configuration files

  4. Command line overrides

Health Checks

The deployment includes health checks:

  • Readiness probes

  • Liveness probes

  • Startup probes

  • Custom health endpoints

Rollback

To rollback a deployment:

wheels docker deploy [target] --rollback

Or manually:

# Kubernetes
kubectl rollout undo deployment/wheels-app

# Docker Swarm
docker service rollback wheels-app

Use Cases

  1. Staging Deployments: Test production configurations

  2. Production Releases: Deploy new versions with zero downtime

  3. Scaling: Adjust replicas based on load

  4. Multi-Region: Deploy to multiple regions/zones

  5. Blue-Green Deployments: Switch between environments

Notes

  • Ensure Docker images are built before deployment

  • Registry authentication must be configured

  • Database migrations should be handled separately or via init containers

  • Monitor deployment logs for troubleshooting

  • Use --dry-run to preview changes before applying

Troubleshooting

Common issues:

  • Image not found: Ensure image is pushed to registry

  • Auth failures: Check registry credentials

  • Resource limits: Adjust CPU/memory settings

  • Port conflicts: Check service port mappings

See Also

Previouswheels docker initNextDeployment Commands

Last updated 2 days ago

Was this helpful?

- Initialize Docker configuration

- General deployment commands

- Push deployments

wheels docker init
wheels deploy
wheels deploy push