Static sites with dev servers now "Just Work"

Some of you ship static sites. Some of you also have a package.json sitting in those repos—usually because you’ve got a nice little dev server setup (Vite, Parcel, Astro, whatever’s in fashion this week). And some of you have noticed Fly.io occasionally looking at that package.json and going:

“Ah, a Node app! Let’s containerize this like a Node app!”

…even when it had no business doing that.

What happened?

We were overly trusting. If we saw a package.json, we assumed you meant it. But plenty of static sites keep one around purely for development, and they absolutely do not want Fly.io running Node in production. The tell? No "start" script. If you weren’t telling us how to start a Node server, you probably weren’t shipping one.

What’s new?

We’ve taught the launch machinery some nuance:

1. If you have a package.json without a start script, we now fall through to the static site handler.
No more false positives. If you ship HTML, you get the static site treatment.

2. Static site handling is now smarter about dev servers.
Before, we’d just look for index.html in the repo root. If it wasn’t there, we shrugged and kept falling. Now we do something more helpful:

  • If we don’t find a variety of other app setups and suspect a static site but don’t see an index.html but do find a package.json, we sniff for common static dev-server configs (Vite, Astro, SvelteKit static builds, Parcel, etc.).

  • We extract the dev server’s base path.

  • If that path has an index.html, we treat that as your deploy root.

  • And instead of shoving your whole dev environment into the image, we only copy that base path into the Dockerfile.

Cleaner images. Correct deployments. Fewer “Why did Fly deploy my entire node_modules???” moments.

Bonus: You’ll see it in flyctl

We now log the detected base path during deploy, so you know exactly what Fly.io thinks your static site root is. You’ll see a log like “Detected a Static (base path: demo) app”.


TL;DR:
Static sites with a package.json meant for dev only are now correctly deployed as static sites, with smart detection of your actual build output path.
You keep your nice dev setup; we keep your image tidy; everyone wins.

:grapes: Happy shipping!

3 Likes