A minimal Hono API running on Bun, ready to deploy on Bunny Magic Containers.
src/index.ts- Hono HTTP server with a Hello World endpointDockerfile- Multi-stage build using the official Bun Alpine imagedocker-compose.yml- Local development setupbunny.json- Magic Containers app config.github/workflows/deploy.yml- GitHub Actions workflow to build, push to GitHub Container Registry, and deploy to Magic Containers
docker compose upcurl http://localhost:3000
# {"message":"Hello world from Magic Containers"}Fork this repository and push to the main branch. The GitHub Actions workflow will automatically build the Docker image and push it to ghcr.io/<your-username>/mc-template-hono-api tagged with both latest and the commit SHA.
Go to your GitHub profile > Packages > select the mc-template-hono-api package > Package settings > change visibility to Public.
- Log in to the bunny.net dashboard and navigate to Magic Containers.
- Click Create App.
- Add the app container:
- Registry: GitHub Container Registry (
ghcr.io) - Image:
ghcr.io/<your-username>/mc-template-hono-api:latest - Add an Endpoint on port
3000
- Registry: GitHub Container Registry (
- Confirm and deploy.
Once deployed, you'll get a *.bunny.run URL:
curl https://mc-xxx.bunny.run
# {"message":"Hello from Magic Containers"}The workflow automatically deploys to Magic Containers on every push to main. Configure the following in your repository settings:
- Variable
APP_ID- your Magic Containers app ID - Secret
BUNNYNET_API_KEY- your bunny.net API key