| name | flyio-local-dev-loop |
| description | Configure Fly.io local development with Docker, proxy, and SSH console.
Use when setting up local dev against Fly services, testing Dockerfiles,
or establishing a fast iteration cycle.
Trigger: "fly.io dev setup", "fly.io local development", "fly proxy".
|
| allowed-tools | Read, Write, Edit, Bash(fly:*), Bash(docker:*), Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","edge-compute","flyio"] |
| compatibility | Designed for Claude Code |
Fly.io Local Dev Loop
Overview
Fast local development workflow for Fly.io apps: build and test Docker containers locally, proxy remote Fly services (Postgres, Redis) to localhost, and use fly deploy for integration testing.
Instructions
Step 1: Local Docker Testing
docker build -t my-app .
docker run -p 3000:3000 \
-e NODE_ENV=development \
-e DATABASE_URL="postgres://localhost:5432/dev" \
my-app
curl http://localhost:3000/health
Step 2: Proxy Remote Fly Services
fly proxy 5432 -a my-db &
psql postgres://postgres:password@localhost:5432/mydb
npx prisma studio
fly proxy 6379 -a my-redis &
redis-cli -h localhost -p 6379
Step 3: Development fly.toml
app = "my-app-dev"
primary_region = "iad"
[env]
NODE_ENV = "development"
LOG_LEVEL = "debug"
[http_service]
internal_port = 3000
auto_stop_machines = "off"
min_machines_running = 1
[[vm]]
cpu_kind = "shared"
cpus = 1
memory = "256mb"
Step 4: Fast Deploy Cycle
fly deploy -a my-app-dev --config fly.dev.toml
fly logs -a my-app-dev --no-tail &
fly ssh console -a my-app-dev
fly apps restart my-app-dev