Fly runs your container as one or more Machines. Use the Node adapter, ship a Dockerfile, and let auto_stop_machines scale you to zero when idle.
fly deploy pipeline
01imageDockerfile builddistroless node:24 image
02fly deployship image to Fly
03Machines + health checksGET /healthz
04auto_stop_machinesscale to zero when idle
Fly runs the container as one or more Machines. Health checks against /healthz gate routing, and auto_stop_machines = stop scales you to zero when traffic drops.
When to choose Fly
You want multiple regions cheaply, with anycast routing for free.
You want a single image that also runs on ECS or Kubernetes elsewhere.
You want raw TCP without a serverless workaround.
Server entrypoint
Use the Node adapter and bind to the Fly-provided PORT:
ts
// src/server.tsimport { serve } from "@daloyjs/core/node";import { app } from "./app.js";serve(app, { port: Number(process.env.PORT ?? 3000), hostname: "0.0.0.0",});
fly.toml
auto_stop_machines takes a string ("off", "stop", or "suspend") and not a boolean.