Deploy Godot Web to Fly.io Fast Booting VMs

I just finished the getting started 2D game for Godot and wanted to host it somewhere and turns out its a little bit more complicated than it seems it needs some custom response headers so I’ve figured how to do that with Caddy.

I invite you to play https://dodge-the-creeps-web.fly.dev/

How to host Godot Web at Fly.io

Here’s the commit that I just made: Fly.io stuff · lubien/godot-dodge-the-creeps@db4c8b8 · GitHub

The magic comes from Caddyfile:

:8080

root * /usr/share/caddy/html

header * {
	Cross-Origin-Embedder-Policy require-corp
	Cross-Origin-Opener-Policy same-origin
	Access-Control-Allow-Origin "*"
}
file_server

That’s it. Just copy Caddyfile and Dockerfile then fly launch it. Too hard amrite?

Future stuff

Just maybe I’m gonna make some GitHub actions to build and deploy this. Let me know if you use Godot and ship to web, maybe we can figure this together.

4 Likes