Containers & Deployment
Fly.io
Container-based Fly.io deployment with generated fly.toml and wrapped flyctl commands
Fly deployment is handled by the Fly module, not the infra deployment module.
How Fly Deployment Works
- Mark apps deployable with
deployment.enable = true - Set
deployment.host = "fly"(or usestackpanel.deployment.defaultHost = "fly") - Configure
deployment.fly.*anddeployment.container.* - Use generated Fly scripts/commands to build, push, and deploy
The module generates apps/<app>/fly.toml, per-app deploy task scripts, and wrapped commands like fly-web.
Configuration
{
stackpanel.deployment.fly = {
organization = "my-fly-org";
defaultRegion = "iad";
};
stackpanel.apps.api = {
path = "apps/server";
framework.hono.enable = true;
deployment = {
enable = true;
host = "fly";
fly = {
appName = "stackpanel-api";
region = "iad";
memory = "512mb";
cpus = 1;
autoStop = "suspend";
autoStart = true;
minMachines = 0;
forceHttps = true;
};
container = {
type = "bun";
port = 3000;
# optional: entrypoint = "node /app/dist/index.js";
};
};
};
}Generated Artifacts
apps/<app>/fly.tomlapps/<app>/.tasks/bin/deploypackages/infra/turbo.jsonpackages/infra/package.jsonscripts for each app:container:build:<app>container:push:<app>deploy:<app>ship:<app>
Common Commands
# Wrapped flyctl commands generated per deployable app
fly-api status
fly-api logs
fly-api deploy
# Infra package scripts generated for Fly apps
bun --cwd packages/infra run container:build:api
bun --cwd packages/infra run container:push:api
bun --cwd packages/infra run deploy:apiFly uses container deployment (flyctl + image push). Cloudflare-style infra:deploy hosting resources are not used for Fly apps.