Deploy containers to Cloudflare with one command.
WARNING: This is early beta software (v0.0.1). Not recommended for production use.
Cloud CLI detects your container setup and generates the necessary Cloudflare Worker configuration to deploy your container to Cloudflare's platform.
- Deploy local Dockerfiles or remote container images
- Auto-detects container projects
- Generates Cloudflare Worker configs
- Supports Dockerfiles, docker-compose, and remote images
- Non-interactive mode for CI/CD
Clone and install locally:
git clone https://github.com/ygwyg/cloud-cli.git
cd cloud-cli
npm install
npm link# Auto-detect and prepare project
cloud
# Auto-detect, prepare, and deploy
cloud --ship
# Show what would happen (dry run)
cloud --plan
# Show detected project type
cloud --detect# Deploy remote images
cloud nginx:alpine --ship
cloud redis:latest --name my-cache --ship
# Deploy local containers
cloud ./Dockerfile --ship
cloud --type container --ship
# Custom configuration
cloud nginx:alpine --name web-server --max-instances 5 --ship--ship- Deploy to cloud after preparation--plan- Show execution plan (dry run)--detect- Show detection results only--type <type>- Force project type (container)--name <name>- Override project name--class <class>- Container class name override--max-instances <number>- Maximum container instances (default: 10)--migration-tag <tag>- Override migration tag--no-prompt- Non-interactive mode (for CI/CD)--force- Overwrite existing files--verbose- Detailed logging
- Scans for container indicators (Dockerfile, docker-compose.yml, image references)
- Analyzes container configuration (ports, environment, etc.)
- Creates Cloudflare Worker proxy and configuration files
- Builds and deploys to Cloudflare's platform
src/index.ts- Cloudflare Worker that proxies requests to your containerwrangler.jsonc- Cloudflare configuration with container settingspackage.json- Dependencies and deployment scripts (if missing)tsconfig.json- TypeScript configuration (if missing).cfignore- Files to ignore during deploymentDockerfile.generated- For remote images
The CLI detects containers based on:
- Dockerfile or Containerfile in the current directory
- docker-compose.yml files
- Remote image references (e.g.,
nginx:alpine) - IMAGE environment variable in .env files
- OCI manifest.json files
- Node.js 16.0.0 or higher
- npm or yarn
- Cloudflare account (for deployment)
Create a cf.config.json file in your project root:
{
"name": "my-container-app",
"maxInstances": 5,
"migrationTag": "v2"
}Set IMAGE=your-image:tag in .env to specify a container image.
- No project detected: Make sure you have a Dockerfile or specify an image
- Deployment fails: Check your Cloudflare credentials and permissions
- Port conflicts: The CLI auto-detects ports from Dockerfile EXPOSE directives
Use --verbose for detailed logging:
cloud nginx:alpine --verbose --shipThis software is in early development. Known limitations:
- Limited error handling
- Basic container detection
- Minimal testing
- API may change
Use at your own risk. Report issues on GitHub.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details.
- Report issues: https://github.com/ygwyg/cloud-cli/issues
- Discussions: https://github.com/ygwyg/cloud-cli/discussions
Deploy any container to Cloudflare with one command.
