bun-deploy
Deploy Bun applications to various platforms
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 0c905b4dfbcb49ec… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
bun-deploy.md
Bun Deployment
Deploy Bun applications to production environments.
Supported Platforms
Docker
Create optimized Dockerfile:
FROM oven/bun:1 AS builder
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build
FROM oven/bun:1-slim
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY package.json ./
USER bun
EXPOSE 3000
CMD ["bun", "run", "dist/index.js"]
Commands:
docker build -t myapp .
docker run -p 3000:3000 myapp
Cloudflare Workers
Update wrangler.toml:
name = "my-worker"
main = "src/index.ts"
compatibility_date = "2024-01-01"
Deploy:
bun run build
bunx wrangler deploy
Vercel
Add vercel.json:
{
"buildCommand": "bun run build",
"installCommand": "bun install",
"framework": null
}
Deploy:
bunx vercel
Fly.io
Create fly.toml:
app = "my-app"
primary_region = "ord"
[build]
dockerfile = "Dockerfile"
[http_service]
internal_port = 3000
force_https = true
[[services.ports]]
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
Deploy:
fly deploy
Railway
Railway auto-detects Bun projects. Add:
{
"scripts": {
"start": "bun run src/index.ts"
}
}
Deploy via Railway CLI or GitHub integration.
Pre-Deployment Checklist
- Build passes -
bun run build - Tests pass -
bun test - Environment variables - All secrets configured
- Health check -
/healthendpoint exists - Logging - Structured logging configured
- Error handling - Global error handlers
- Security headers - CORS, CSP configured
- Database migrations - Applied if needed
Environment Configuration
# Generate .env.example from .env
grep -v '^#' .env | sed 's/=.*/=/' > .env.example
# Required variables
DATABASE_URL=
API_SECRET=
NODE_ENV=production
Health Check Endpoint
app.get("/health", (c) => {
return c.json({
status: "ok",
timestamp: new Date().toISOString(),
version: process.env.VERSION || "unknown",
});
});
Logging Setup
function log(level: string, message: string, data?: object) {
console.log(JSON.stringify({
level,
message,
timestamp: new Date().toISOString(),
...data,
}));
}
Monitoring
Add basic metrics:
let requestCount = 0;
let errorCount = 0;
app.use("*", async (c, next) => {
requestCount++;
try {
await next();
} catch (err) {
errorCount++;
throw err;
}
});
app.get("/metrics", (c) => {
return c.json({
requests: requestCount,
errors: errorCount,
uptime: process.uptime(),
});
});
Questions to Ask
If platform not specified:
- "Where do you want to deploy? (Docker, Cloudflare, Vercel, Fly.io, Railway)"
Additional questions:
- "Do you need a database?"
- "What region should it deploy to?"
- "Do you have a domain name?"
Deployment Steps
- Verify platform requirements
- Create necessary config files
- Set environment variables
- Run deployment command
- Verify health check
- Test production endpoints
Output
After deployment:
- Deployment URL
- Environment details
- Monitoring commands
- Rollback instructions
Files
1- bun-deploy.md
a06b542fa73.5 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from secondsky/claude-skills8
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
Run a focused blindspot pass for unfamiliar, ambiguous, or high-risk work
Debug Bun applications and diagnose common issues
Initialize a new Bun project with optional framework selection
Migrate existing Node.js/npm projects to Bun
Optimize Bun application performance and bundle size
Upgrade Bun runtime and project dependencies
Related devops skillsscan passed
When user is asking for guidance for which role to assign to an identity given desired permissions, this agent helps them understand the role that will meet the requirements with least privilege access and how to apply that role.
Generate a GitHub Actions workflow to deploy the VitePress wiki site to GitHub Pages
Deploy Sanity schema to the Content Lake with verification.
Design and implement batch and streaming data pipelines with ingestion, orchestration, dbt transformations, data quality checks, and monitoring