8eef6ea9dc43cd04f1bf88817723d809cf6c9f7d
Swarm Demo
A minimal demo app built with Bun, Hono, React, and Tailwind CSS.
Displays the container hostname and a live updating date/time — useful for verifying load balancing across a swarm of containers.
Stack
- Bun — runtime, package manager, bundler, and dev server
- Hono — lightweight web server
- React — UI
- Tailwind CSS — styling
Scripts
| Command | Description |
|---|---|
bun install |
Install dependencies |
bun run dev |
Start Bun dev server with HMR + Tailwind watch |
bun run build |
Build CSS + bundle for production |
bun run preview |
Build and start production server |
bun run serve |
Start production server (requires dist/) |
Docker
# Build and run locally
docker build -t swarm-demo .
docker run -p 5786:5786 swarm-demo
# Or use Docker Compose with 3 replicas
docker compose up --build
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
5786 |
Server port |
HOSTNAME |
localhost |
Container name (set automatically by Docker) |
Description
Languages
TypeScript
73%
HTML
11.2%
JavaScript
6.9%
Dockerfile
6.7%
CSS
2.2%