1
0
Fork 0
mirror of https://github.com/imjasonh/terraform-playground synced 2026-07-06 23:12:22 +00:00
terraform-playground/cf-worker-container
copilot-swe-agent[bot] ae34b14b29 Add Terraform infrastructure for pr-risk-scorer deployment
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:12:12 +00:00
..
.gitignore cf-worker-container 2025-11-03 13:37:22 -05:00
Dockerfile cf-worker-container 2025-11-03 13:37:22 -05:00
go.mod Add Terraform infrastructure for pr-risk-scorer deployment 2026-02-18 17:12:12 +00:00
go.sum Add Terraform infrastructure for pr-risk-scorer deployment 2026-02-18 17:12:12 +00:00
index.js cf-worker-container 2025-11-03 13:37:22 -05:00
main.go cf-worker-container 2025-11-03 13:37:22 -05:00
package-lock.json cf-worker-container 2025-11-03 13:37:22 -05:00
package.json cf-worker-container 2025-11-03 13:37:22 -05:00
README.md cf-worker-container 2025-11-03 13:37:22 -05:00
wrangler.toml cf-worker-container 2025-11-03 13:37:22 -05:00

Cloudflare Workers Containers

This is an experiment using Cloudflare Workers Containers to host a Go application on Workers.

Findings:

  • You can't just write Go, you also need to write a simple index.js that handles the Worker request and forwards it to the Container durable object
    • On the plus side, that also means it can forward to multiple containers, which could be interesting
  • You can't just give it a pre-built image; Cloudflare wants to either build it from a Dockerfile and your source, or a publicly pullable image
    • Because Cloudflare wants to do the build, you can't even just do FROM <ko-built-image> if that image is private 😭
  • R2 integration is very DIY; regular Workers have a nice clean API for R2 access, but Containers need to be passed regular API creds via env
  • Monitoring and observability of Containers seem pretty limited
    • The Worker wrapper logs are available, and the Container logs are available via DO, but Container startup logs seem to go into a black hole, which is frustrating when you're debugging startup issues
  • I couldn't see any Terraform support, only declarative wrangler deploy

Due to these limitations, I don't see a lot of upside to using CF Containers over something like Cloud Run, even if it might cost a bit more. 🤷