From bbrewington-tools
Deploys and manages Fly.io apps using Docker containers, Fly Machines, fly.toml configs, databases, volumes, secrets. Supports fly launch/deploy, debugging, multi-region setups for Python/Node/Rails/Django apps.
npx claudepluginhub bbrewington/software-data-and-ai-tools --plugin bbrewington-toolsThis skill uses the workspace's default tool permissions.
Deploy applications globally using Fly.io's platform of hardware-virtualized containers (Fly Machines) with instant launch capabilities and edge networking.
Deploys, scales, and manages Fly.io apps: configure fly.toml, run flyctl for secrets/regions/lifecycle, handle Docker builds and multi-region scaling.
Provides quick reference for Fly.io PaaS deployments including fly.toml config, global distribution, scaling patterns, secrets management, health checks, and troubleshooting. Auto-loads on fly.toml detection.
Deploys apps to Render by analyzing codebases, generating render.yaml blueprints, and providing dashboard deeplinks. For Git-backed services, Docker images, databases, and cron jobs.
Share bugs, ideas, or general feedback.
Deploy applications globally using Fly.io's platform of hardware-virtualized containers (Fly Machines) with instant launch capabilities and edge networking.
Common workflows:
fly launch - Initialize and deploy new app (auto-generates fly.toml and Dockerfile)fly deploy - Deploy changes to existing appfly status - Check app health and machine statusfly logs - View application logsfly ssh console - SSH into running machinePrerequisites:
fly auth loginFrom your project directory:
fly launch
This command:
Customization flags:
--no-deploy - Configure without deploying--name <app-name> - Specify app name--region <code> - Set primary region (e.g., atl for Atlanta)--org <org-name> - Deploy to specific organization--image <image> - Use existing Docker imagePython (Flask/FastAPI/Django):
requirements.txt or pyproject.tomlNode.js:
package.jsonFor data engineering/dbt projects:
The fly.toml file controls app deployment. Key sections:
# App metadata
app = "my-app"
primary_region = "atl"
# Build configuration
[build]
dockerfile = "Dockerfile" # or use [build.image = "..."]
# Environment variables (non-sensitive)
[env]
PORT = "8080"
ENVIRONMENT = "production"
# HTTP service configuration
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
# Health checks
[[http_service.checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
timeout = "5s"
path = "/health"
# Process groups (for multi-process apps)
[processes]
web = "gunicorn main:app"
worker = "celery -A tasks worker"
# Volume mounts (persistent storage)
[[mounts]]
source = "data_volume"
destination = "/data"
# VM resources
[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
Common configurations:
Auto-scaling for cost optimization:
[http_service]
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0 # Stop all when idle
Multiple regions:
fly scale count 2 --region atl,ord
Secrets management:
fly secrets set API_KEY=xxx DATABASE_URL=yyy
fly secrets list
Specify strategy with fly deploy --strategy <type>:
rolling (default) - Update machines sequentiallyimmediate - Update all at once (brief downtime)canary - Deploy to one machine, verify, then roll outbluegreen - Deploy alongside existing, switch traffic when readyfly deploy
fly logs # Live logs
fly logs --region atl # Specific region
fly scale count 3 # Set machine count
fly scale memory 512 # Increase RAM (MB)
fly scale vm shared-cpu-2x # Change VM size
fly scale count 2 --region atl,ord # Multi-region
fly volumes create data_volume --size 1 # Create 1GB volume
fly volumes list
fly postgres create --name myapp-db # Postgres
fly redis create # Redis (via Upstash)
fly ssh console # Interactive shell
fly ssh console -C "python manage.py migrate" # Run command
fly releases # List releases
fly deploy --image <app>:<release> # Deploy specific release
Typical structure:
project/
├── app/
│ ├── __init__.py
│ └── main.py
├── requirements.txt
├── Dockerfile # Generated by fly launch
├── fly.toml # Generated by fly launch
└── .dockerignore
Minimal Dockerfile for Python (if customizing):
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["gunicorn", "app.main:app", "--bind", "0.0.0.0:8080"]
Example workflow for automated deployments:
name: Deploy to Fly.io
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Generate token: fly tokens create deploy
In fly.toml:
[processes]
web = "gunicorn main:app"
worker = "celery -A tasks worker"
# Different scaling per process
[[http_service]]
processes = ["web"]
internal_port = 8080
[[services]]
processes = ["worker"]
# No HTTP service for workers
Deploy:
fly deploy
fly scale count web=2 worker=1
Build failures:
fly logs --region atlApp won't start:
internal_port matches your app's portfly logsConnection issues:
fly ips listfly statusPerformance issues:
fly scale memory 1024fly regions add ord laxfly statusfly-toml-reference.md - Complete fly.toml configuration optionsdeployment-patterns.md - Common deployment architecturespython-examples.md - Python-specific deployment examplesfly.toml.template - Starter templates for common app typesgithub-actions-workflow.yml - CI/CD workflow template