
bun-deploy
Generate optimized Docker images for Bun applications. Use when deploying to containers, minimizing image sizes, setting up CI/CD pipelines, or deploying to Kubernetes.
- Installs
- 51
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/daleseo/bun-skills --skill bun-deploy- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads bun-deploy automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Bun Docker Deployment
Create optimized Docker images for Bun applications. Bun's small runtime and binary compilation reduce image sizes by 88MB+ compared to Node.js.
Quick Reference
For detailed patterns, see:
- Dockerfile Templates: dockerfile-templates.md - 12+ optimized templates
- Kubernetes: kubernetes.md - K8s manifests, HPA, ingress
- CI/CD: ci-cd.md - GitHub Actions, GitLab CI, build scripts
- Multi-Platform: multi-platform.md - ARM64/AMD64 builds
Core Workflow
1. Check Prerequisites
# Verify Docker is installed
docker --version
# Verify Bun is installed locally
bun --version
# Check if project is ready for deployment
ls -la package.json bun.lockb
2. Determine Deployment Strategy
Ask the user about their needs:
- Application Type: Web server, API, worker, or CLI
- Image Size Priority: Minimal size (40MB binary) vs. debugging tools (90MB Alpine)
- Platform: Single platform or multi-platform (AMD64 + ARM64)
- Orchestration: Docker Compose, Kubernetes, or standalone containers
3. Create Production Dockerfile
Choose the appropriate template based on needs:
Standard Multi-Stage (Recommended)
# syntax=docker/dockerfile:1
FROM oven/bun:1-alpine AS deps
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile --production
FROM oven/bun:1-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bun run build
FROM oven/bun:1-alpine AS runtime
WORKDIR /app
RUN addgroup --system --gid 1001 bunuser && \
adduser --system --uid 1001 bunuser
COPY --from=deps --chown=bunuser:bunuser /app/node_modules ./node_modules
COPY --from=builder --chown=bunuser:bunuser /app/dist ./dist
COPY --from=builder --chown=bunuser:bunuser /app/package.json ./
USER bunuser
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD bun run healthcheck.ts || exit 1
CMD ["bun", "run", "dist/index.js"]
Minimal Binary (40MB)
For smallest possible images:
FROM oven/bun:1-alpine AS builder
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun build ./src/index.ts --compile --outfile server
FROM gcr.io/distroless/base-debian12
COPY --from=builder /app/server /server
EXPOSE 3000
ENTRYPOINT ["/server"]
For other scenarios (monorepo, database apps, CLI tools, etc.), see dockerfile-templates.md.
4. Create .dockerignore
node_modules
bun.lockb
dist
*.log
.git
.env
.env.local
tests/
*.test.ts
coverage/
.vscode/
.DS_Store
Dockerfile
docker-compose.yml
5. Create Health Check Script
Create healthcheck.ts:
#!/usr/bin/env bun
const port = process.env.PORT || 3000;
const healthEndpoint = process.env.HEALTH_ENDPOINT || '/health';
try {
const response = await fetch(`http://localhost:${port}${healthEndpoint}`, {
method: 'GET',
timeout: 2000,
});
if (response.ok) {
process.exit(0);
} else {
console.error(`Health check failed: ${response.status}`);
process.exit(1);
}
} catch (error) {
console.error('Health check error:', error);
process.exit(1);
}
Add health endpoint to your server:
app.get('/health', (req, res) => {
res.json({
status: 'ok',
timestamp: Date.now(),
uptime: process.uptime(),
});
});
6. Build and Test Image
# Build image
docker build -t myapp:latest .
# Check image size
docker images myapp:latest
# Run container
docker run -p 3000:3000 myapp:latest
# Test health endpoint
curl http://localhost:3000/health
7. Setup for Environment
For Local Development with Docker Compose:
Create docker-compose.yml:
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
depends_on:
- db
- redis
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: mydb
ports:
- "5432:5432"
redis:
image: redis:7-alpine
ports:
- "6379:6379"
Run with: docker-compose up
For Kubernetes Deployment:
See kubernetes.md for complete manifests including:
- Deployment configuration
- Service and Ingress
- Secrets and ConfigMaps
- Horizontal Pod Autoscaling
- Resource limits optimized for Bun
For CI/CD:
See ci-cd.md for:
- GitHub Actions workflow
- GitLab CI configuration
- Build and push scripts
- Automated deployments
For Multi-Platform (ARM64 + AMD64):
See multi-platform.md for:
- Multi-platform Dockerfile
- Buildx configuration
- Testing on different architectures
8. Update package.json
Add Docker scripts:
{
"scripts": {
"docker:build": "docker build -t myapp:latest .",
"docker:run": "docker run -p 3000:3000 myapp:latest",
"docker:dev": "docker-compose up",
"docker:clean": "docker system prune -af"
}
}
Image Size Comparison
Bun produces significantly smaller images:
| Configuration | Size | Use Case |
|---|---|---|
| Bun Binary (distroless) | ~40 MB | Production (minimal) |
| Bun Alpine | ~90 MB | Production (standard) |
| Node.js Alpine | ~180 MB | Baseline comparison |
88MB+ savings with Bun!
Security Best Practices
- Use non-root user (included in Dockerfiles above)
- Scan for vulnerabilities:
docker scan myapp:latest - Use official base images:
oven/bunis official - Keep images updated: Rebuild regularly with latest Bun
- Never hardcode secrets: Use environment variables or secret managers
Optimization Tips
Layer caching:
# Copy dependencies first (changes less often)
COPY package.json bun.lockb ./
RUN bun install
# Copy source code last (changes more often)
COPY . .
RUN bun run build
Reduce layer count:
# Combine RUN commands
RUN bun install && \
bun run build && \
rm -rf tests/
Minimize final image:
# Only copy what's needed in runtime
COPY --from=builder /app/dist ./dist
# Don't copy: src/, tests/, .git/, node_modules (if using binary)
Completion Checklist
- ✅ Dockerfile created (multi-stage or binary)
- ✅ .dockerignore configured
- ✅ Health check implemented
- ✅ Non-root user configured
- ✅ Image built and tested locally
- ✅ Image size verified (<100MB for Alpine, <50MB for binary)
- ✅ Environment configuration ready (docker-compose or K8s)
- ✅ CI/CD pipeline configured (if needed)
Next Steps
After basic deployment:
- Monitoring: Add Prometheus metrics endpoint
- Logging: Configure structured logging
- Secrets: Set up proper secret management
- Scaling: Configure horizontal pod autoscaling (K8s)
- CI/CD: Automate builds and deployments
- Multi-region: Deploy to multiple regions for redundancy
For detailed implementations, see the reference files linked above.
FAQ
What does the bun-deploy skill do?
Generate optimized Docker images for Bun applications. Use when deploying to containers, minimizing image sizes, setting up CI/CD pipelines, or deploying to Kubernetes.
How do I install bun-deploy?
Run npx skills add https://github.com/daleseo/bun-skills --skill bun-deploy in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/bun-deploy/ (personal) or .claude/skills/bun-deploy/ (project).
Which AI agents can use bun-deploy?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is bun-deploy safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains bun-deploy?
It is published by daleseo in daleseo/bun-skills. It has 51 recorded installs.
More from daleseo/bun-skills
bun-test
daleseo/bun-skills
Open the skill to read its SKILL.md instructions.
bun-build
daleseo/bun-skills
Open the skill to read its SKILL.md instructions.
node-to-bun
daleseo/bun-skills
Migrate Node.js projects to Bun with compatibility analysis. Use when converting existing npm/pnpm/yarn projects to Bun or auditing dependencies for Bun compatibility.
bun-dev-server
daleseo/bun-skills
Set up high-performance development servers with Hot Module Replacement. Use when creating dev servers for web apps, setting up React Fast Refresh, or configuring API servers with live reload.
bun-init
daleseo/bun-skills
Open the skill to read its SKILL.md instructions.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.