Skip to content

sasobunny/124124124

Repository files navigation

Hono API for Magic Containers

A minimal Hono API running on Bun, ready to deploy on Bunny Magic Containers.

What's included

  • src/index.ts - Hono HTTP server with a Hello World endpoint
  • Dockerfile - Multi-stage build using the official Bun Alpine image
  • docker-compose.yml - Local development setup
  • bunny.json - Magic Containers app config
  • .github/workflows/deploy.yml - GitHub Actions workflow to build, push to GitHub Container Registry, and deploy to Magic Containers

Run locally

docker compose up
curl http://localhost:3000
# {"message":"Hello world from Magic Containers"}

Deploy to Magic Containers

1. Fork and push

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.

2. Make the package public

Go to your GitHub profile > Packages > select the mc-template-hono-api package > Package settings > change visibility to Public.

3. Create an app on Magic Containers

  1. Log in to the bunny.net dashboard and navigate to Magic Containers.
  2. Click Create App.
  3. 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
  4. Confirm and deploy.

4. Test it

Once deployed, you'll get a *.bunny.run URL:

curl https://mc-xxx.bunny.run
# {"message":"Hello from Magic Containers"}

Continuous deployment

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors