This is a template project for deploying an ElysiaJS application using Bun to Fly.io.
Ensure you have the following installed:
-
Clone the repository:
git clone <your-repository-url> cd fly-io-elysia-template
-
Install dependencies:
bun install
To start the development server with hot-reloading:
bun run devThe application will be available at http://localhost:3000.
The Dockerfile handles the build process. When deploying to Fly.io, the bun install --ci command will be executed within the Docker container.
-
Login to Fly.io (if you haven't already):
fly auth login
-
Launch the app (if it's the first time):
fly launch
This will detect your
fly.tomlandDockerfileand guide you through the initial deployment setup. -
Deploy changes: After making changes, deploy them with:
fly deploy
.
├── .dockerignore # Specifies intentionally untracked files that Docker should ignore
├── .gitignore # Specifies intentionally untracked files that Git should ignore
├── Dockerfile # Defines the Docker image for deployment
├── bun.lockb # Bun lockfile
├── fly.toml # Fly.io configuration file
├── package.json # Project metadata and dependencies
├── README.md # This file
├── tsconfig.json # TypeScript configuration
└── src/
└── index.ts # Main application entry point- ElysiaJS: A fast, and ergonomic web framework for Bun and Node.js.
- Bun: A fast JavaScript all-in-one toolkit.
- TypeScript: Superset of JavaScript that adds static types.
- Fly.io: Platform for deploying applications close to users.