# Cloudflare Containers configuration for PR preview deployments # This file is used as a template - the GitHub workflow substitutes PR_NUMBER name = "sure-preview-${PR_NUMBER}" main = "./src/index.ts" compatibility_date = "2026-05-11" # Enable workers.dev subdomain for preview access workers_dev = true # Enable container logs [observability] enabled = true # Container configuration - uses preview Dockerfile with embedded PostgreSQL # Note: path is relative to this config file location [[containers]] class_name = "RailsContainer" image = "../../Dockerfile.preview" # standard-1 (1/2 vCPU, 4 GiB RAM, 8 GB disk), not basic (1/4 vCPU, 1 GiB, # 4 GB): this single container runs postgres + redis + puma AND generates the # full demo dataset (Demo::Generator: ~12 years of transactions). That # generation peaks just over 1 GiB, so basic OOM-kills it (exit 137) mid-boot # and the preview never reaches demo-data-ready. Verified on a real Cloudflare # standard-1 deploy: rails ready ~46s, demo data ~149s, previewReady ~195s, # peak well under 4 GiB, no OOM. instance_type = "standard-1" max_instances = 1 # Durable Object binding for the container [[durable_objects.bindings]] name = "RAILS_CONTAINER" class_name = "RailsContainer" # Required migration for Durable Objects with SQLite [[migrations]] tag = "v1" new_sqlite_classes = ["RailsContainer"] # Environment variables passed to the Rails container [vars] RAILS_ENV = "development" RAILS_LOG_TO_STDOUT = "true" RAILS_SERVE_STATIC_FILES = "true" # Note: SECRET_KEY_BASE and DATABASE_URL are auto-generated by the entrypoint # for development previews. For custom configuration, set via: # wrangler secret put SECRET_KEY_BASE