DriteStudio
DRITESTUDIOCloud Infrastructure
Home
ArticlesAbout UsContactStatus
0%
Cloudflare Containers Beta: Docker Edge Workers Auto-scale Pay-per-running
Back to articles

Cloudflare Containers Beta: Docker Edge Workers Auto-scale Pay-per-running

Cloudflare Containers Public Beta 2025 Docker edge deployment Workers Durable Objects FFmpeg AI inference code sandbox global 320 cities pricing examples

Server Category-June 27, 2025-Updated: February 24, 2026

Cloudflare Containers Public Beta 2025: รัน Docker Edge 320+ Cities Auto-scale

Cloudflare Containers รันคอนเทนเนอร์ทั่วโลกผ่าน Workers + Durable Objects Latency ต่ำสุด Sandbox per user Media processing AI inference Pay-per-running-time

Cloudflare Containers vs Competition

PlatformGlobal EdgeWorkers IntegrationCold StartPricing
Cloudflare320 citiesNative200msRunning only
Fly.io35 regions❌500msAlways-on
Render8 regions❌1sIdle charges
RailwayMulti-cloud❌800msFixed scale

Core Architecture

Request → Workers → Durable Objects → Containers
                        ↓
              Auto-scale + Health checks

คุณสมบัติหลัก

🌍 Global deployment (320+ cities)
⚙️ Workers orchestration
💤 Sleep after idle (pay-per-use)
🔒 Per-container sandboxing
🌐 HTTP/WebSocket support
📈 Auto-scaling (CPU/memory)

Quick Deploy Example

// wrangler.toml
[[containers]]
name = "ffmpeg-converter"
image = "myregistry/ffmpeg:latest”
port = 8080
sleep_after = "1m”
min_instances = 1

// worker.js  
export default {
  async fetch(request, env) {
    const container = env.FFMPEG.get(env.FFMPEG.idFromName("user123"));
    return container.fetch(request);
  }
}
npx wrangler deploy

Real-world Use Cases

1. Code Sandbox (Per User)

User1 → Container1 (Node.js)
User2 → Container2 (Python)
User3 → Container3 (Go)

2. FFmpeg Media Processing

Upload MP4 → Edge container → GIF output
Latency: 150ms (vs 2s centralized)

3. AI Model Inference

User request → Boot Llama.cpp → Inference → Sleep
Cost: $0.0001 per request

Pricing Model (Pay-per-running)

Running: $0.000015/GB-second
Sleep: $0 (free)
Boot time: 200ms (billed)
Min 1 instance: Configurable

ตัวอย่าง: 1000 req/day × 30s = $0.45/เดือน

Production Config

# wrangler.toml
[[containers]]
name = "app"
image = "docker.io/myapp:latest"
port = 3000
min_instances = 2
max_instances = 50
sleep_after = "5m"
cpu_threshold = 0.75
memory_threshold = 0.8

Advanced Patterns

Service Mesh via Workers

// Load balance 10 containers
const containers = Array(10).fill().map((_, i) => 
  env.APP.get(env.APP.idFromName(`inst-${i}`))
);
const container = containers[Math.floor(Math.random() * 10)];
return container.fetch(request);

Health Checking

export class ContainerProxy {
  async fetch(request) {
    try {
      const res = await this.container.fetch('/health');
      if (!res.ok) throw new Error('Unhealthy');
      return this.container.fetch(request);
    } catch {
      // Spin up new container
      await this.restart();
    }
  }
}

Limitations

❌ No TCP/UDP (HTTP/WebSocket only)
❌ Cloudflare network only
⚠️ Cold start 200ms (acceptable)
✅ Perfect for stateless workloads

Migration from Other Platforms

Docker → Cloudflare: 5 mins setup
K8s → Containers: No YAML hell
Lambda → Containers: Full runtime
Vercel → Edge Containers: Global
Share article:
View more articles
D

DriteStudio | ไดรท์สตูดิโอ

Cloud, VPS, Hosting and Colocation provider in Thailand

Operated by Craft Intertech (Thailand) Co., Ltd.

DRITESTUDIOCloud Infrastructure

100/280 Soi 17, Delight Village, Bang Khun Thian - Chaitalay, Phanthai Norasing, Samut Sakhon 74000

Services

  • VPS Hosting
  • Dedicated Server
  • Web Hosting
  • Security Solutions

Company

  • About Us
  • Contact Us
  • System Status

Support

  • Support Ticket
  • Documentation
  • Help Center

© 2026 Craft Intertech (Thailand) Co., Ltd. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy

We use cookies

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies. Privacy Policy