@celsian/adapter-fly
v0.6.1
Published
CelsianJS adapter for Fly.io: generates fly.toml, Dockerfile, and multi-region config
Maintainers
Readme
CelsianJS Fly.io Adapter
Generate Fly.io deployment files (fly.toml, Dockerfile) for CelsianJS apps. This is a build-time deploy adapter, not an HTTP handler.
Part of the CelsianJS monorepo. See the root README for full framework docs.
Installation
npm install @celsian/adapter-flyUsage
The adapter is a plain object with a buildEnd() method that writes the files.
Call it from a post-build script:
// scripts/generate-fly-config.ts
import { flyAdapter } from '@celsian/adapter-fly';
const adapter = flyAdapter({
appName: 'my-app',
primaryRegion: 'iad',
regions: ['lhr', 'nrt'],
healthCheckPath: '/health',
});
await adapter.buildEnd({
serverEntry: 'dist/index.js',
clientDir: 'dist/client',
staticDir: 'public',
outDir: '.',
});node --experimental-strip-types scripts/generate-fly-config.tsThat writes fly.toml, Dockerfile and .dockerignore into outDir; deploy
with fly deploy. Because Fly runs a long-lived server, app.task() workers and
app.cron() schedulers run normally here.
This adapter is not wired into
celsian.config.ts.CelsianConfighas nobuild.adapterkey, so thedefineConfig({ build: { adapter } })form this README used to show did not type-check and was never read bycelsian build.
License
MIT
