fly-io
Dockerアプリを世界中のFly.ioエッジ環境に展開する際に、複数リージョンの設定や永続ストレージの構築、グローバルデータベースの管理などを支援するSkill。
📜 元の英語説明(参考)
Assists with deploying applications globally on Fly.io edge infrastructure. Use when deploying Docker-based apps, configuring multi-region machines, setting up persistent storage, or managing global databases. Trigger words: fly.io, fly deploy, fly machines, fly launch, multi-region, edge deployment, flyctl.
🇯🇵 日本人クリエイター向け解説
Dockerアプリを世界中のFly.ioエッジ環境に展開する際に、複数リージョンの設定や永続ストレージの構築、グローバルデータベースの管理などを支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o fly-io.zip https://jpskill.com/download/14912.zip && unzip -o fly-io.zip && rm fly-io.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14912.zip -OutFile "$d\fly-io.zip"; Expand-Archive "$d\fly-io.zip" -DestinationPath $d -Force; ri "$d\fly-io.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
fly-io.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
fly-ioフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Fly.io
概要
Fly.io は、30 以上の世界中のエッジリージョンにわたって Firecracker microVM にアプリケーションをデプロイし、ユーザーに 50ms 未満のレイテンシーを提供します。スケール・トゥ・ゼロのマシン、永続的な NVMe ボリューム、マルチリージョン SQLite レプリケーション用の LiteFS、およびサービス間のプライベート WireGuard ネットワークをサポートしています。
手順
- アプリケーションをデプロイする際は、
fly launchを使用してフレームワークを自動検出し、Dockerfile を生成し、次にfly deployを使用して、ヘルスチェックによるゼロダウンタイムのローリングアップデートを行います。 - スケーリングを構成する際は、
fly.tomlでauto_stop_machinesとauto_start_machinesを使用して、アイドル時にゼロにスケールし、受信リクエスト時に起動するようにし、ワークロードに適したマシンサイズを設定します。 - マルチリージョンデプロイメントを管理する際は、
fly scale count --regionを使用してマシンを分散させ、fly-replayヘッダーを使用して書き込みをプライマリリージョンにルーティングし、SQLite リードレプリカには LiteFS を使用します。 - 永続的なデータを処理する際は、永続ストレージ用のボリュームをアタッチし(マシンはエフェメラルです)、マルチリージョン SQLite には LiteFS を使用し、S3 互換のオブジェクトストレージには Tigris を使用します。
- サービスを接続する際は、WireGuard メッシュ経由のプライベートなサービス間通信には
.internalDNS を使用し、内部サービスをパブリックインターネットに公開しないでください。 - シークレットを管理する際は、暗号化されたシークレットストレージとして
fly secrets set KEY=valueを使用し、環境変数としてアクセスできるようにします。 - トラブルシューティングを行う際は、リアルタイムストリーミングには
fly logsを使用し、実行中のマシンにアクセスするにはfly ssh consoleを使用し、内部サービスへのトンネルにはfly proxyを使用します。
例
例 1: マルチリージョン Web アプリケーションのデプロイ
ユーザーリクエスト: 「Fly.io を使用して、米国、ヨーロッパ、アジアでアプリをグローバルにデプロイしたい」
アクション:
fly launchで初期化し、Dockerfile を構成します。- 3 つのリージョンにマシンをデプロイします:
fly scale count 2 --region iad,cdg,nrt - リージョン間の SQLite レプリケーション用に LiteFS をセットアップします。
- プライマリリージョンへの書き込みルーティング用に
fly-replayヘッダーを構成します。
出力: 3 つのリージョンにリードレプリカがあり、自動書き込みルーティングを備えたグローバルに分散されたアプリ。
例 2: コスト効率の高いステージング環境の構成
ユーザーリクエスト: 「使用されていないときにゼロにスケールする Fly.io ステージング環境をセットアップしたい」
アクション:
fly launchでステージングアプリを作成します。fly.tomlでauto_stop_machines = "stop"とauto_start_machines = trueを構成します。- 永続的なデータベースストレージ用のボリュームをアタッチします。
- ルーティング用に適切なタイムアウトでヘルスチェックを設定します。
出力: アイドル状態のマシンを停止し、次のリクエストで 1 秒未満で起動するステージング環境。
例 3: 自動ロールバックによるカナリアデプロイメント
ユーザーリクエスト: 「Fly.io にアプリをデプロイしたいが、最初に 1 台のマシンでテストしたい。ヘルスチェックが失敗した場合は、ロールバックしたい。」
アクション:
--strategy canaryでデプロイして、新しいマシンを 1 台起動します。- アプリのヘルスエンドポイントでカナリアマシンのヘルスチェックを行います。
- 正常な場合は、
fly deploy --strategy rollingでプロモートして、すべてのマシンを置き換えます。 - 異常な場合は、
fly releases rollbackでロールバックします。
#!/bin/bash
# deploy-canary.sh — Fly.io の自動ロールバックによるカナリアデプロイメント
set -euo pipefail
APP="${1:?Usage: deploy-canary.sh <app-name>}"
HEALTH_PATH="${2:-/api/health}"
echo "🐤 Deploying canary..."
fly deploy --app "$APP" --strategy canary --wait-timeout 120
HEALTH_URL="https://${APP}.fly.dev${HEALTH_PATH}"
HEALTHY=false
DEADLINE=$((SECONDS + 60))
while [ $SECONDS -lt $DEADLINE ]; do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$HEALTH_URL" || true)
[ "$STATUS" = "200" ] && HEALTHY=true && break
sleep 3
done
if [ "$HEALTHY" = true ]; then
echo "✅ Canary healthy! Promoting..."
fly deploy --app "$APP" --strategy rolling
echo "🎉 Production deploy complete"
else
echo "❌ Canary failed! Rolling back..."
fly releases rollback --app "$APP"
echo "⏪ Rolled back"
exit 1
fi
ガイドライン
- コストを節約するために、開発/ステージングには
auto_stop_machines = "stop"を使用します。マシンはアイドルタイムアウト後に停止します。 - マシンが 1 秒未満のコールドスタートで受信リクエスト時に起動するように、
auto_start_machines = trueを維持します。 - サービス間呼び出しには
.internalDNS を使用します。内部サービスを公開しないでください。 - マシンはエフェメラルであるため、永続的なデータはマシンファイルシステムではなく、ボリュームに保存します。
- マルチリージョン読み取りが必要な SQLite アプリには LiteFS を使用します。PostgreSQL レプリケーションよりも簡単です。
- リアルなタイムアウトでヘルスチェックを設定します。Fly Proxy は、モニタリングだけでなく、ルーティングにもそれらを使用します。
- マルチリージョンセットアップで書き込み操作を行うには、プライマリリージョンにルーティングするために
fly-replayヘッダーを使用します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Fly.io
Overview
Fly.io deploys applications to Firecracker microVMs across 30+ edge regions worldwide, providing sub-50ms latency to users. It supports scale-to-zero machines, persistent NVMe volumes, LiteFS for multi-region SQLite replication, and private WireGuard networking between services.
Instructions
- When deploying applications, use
fly launchto auto-detect the framework and generate a Dockerfile, thenfly deployfor zero-downtime rolling updates with health checks. - When configuring scaling, use
auto_stop_machinesandauto_start_machinesinfly.tomlto scale to zero when idle and wake on incoming requests, and set machine sizing appropriate to the workload. - When managing multi-region deployments, use
fly scale count --regionto distribute machines,fly-replayheader to route writes to the primary region, and LiteFS for SQLite read replicas. - When handling persistent data, attach volumes for durable storage (machines are ephemeral), use LiteFS for multi-region SQLite, or Tigris for S3-compatible object storage.
- When connecting services, use
.internalDNS for private service-to-service communication over the WireGuard mesh and never expose internal services to the public internet. - When managing secrets, use
fly secrets set KEY=valuefor encrypted secret storage accessible as environment variables. - When troubleshooting, use
fly logsfor real-time streaming,fly ssh consoleto access running machines, andfly proxyto tunnel to internal services.
Examples
Example 1: Deploy a multi-region web application
User request: "Deploy my app globally with Fly.io in US, Europe, and Asia"
Actions:
- Initialize with
fly launchand configure Dockerfile - Deploy machines to three regions:
fly scale count 2 --region iad,cdg,nrt - Set up LiteFS for SQLite replication across regions
- Configure
fly-replayheader for write routing to the primary region
Output: A globally distributed app with read replicas in three regions and automatic write routing.
Example 2: Configure a cost-efficient staging environment
User request: "Set up a Fly.io staging environment that scales to zero when not in use"
Actions:
- Create a staging app with
fly launch - Configure
auto_stop_machines = "stop"andauto_start_machines = trueinfly.toml - Attach a volume for persistent database storage
- Set health checks with appropriate timeouts for routing
Output: A staging environment that stops idle machines and wakes in sub-second on the next request.
Example 3: Canary deployment with auto-rollback
User request: "Deploy my app to Fly.io but test on one machine first. If the health check fails, roll back."
Actions:
- Deploy with
--strategy canaryto spin up a single new machine - Health check the canary machine at the app's health endpoint
- If healthy, promote with
fly deploy --strategy rollingto replace all machines - If unhealthy, rollback with
fly releases rollback
#!/bin/bash
# deploy-canary.sh — Fly.io canary deployment with auto-rollback
set -euo pipefail
APP="${1:?Usage: deploy-canary.sh <app-name>}"
HEALTH_PATH="${2:-/api/health}"
echo "🐤 Deploying canary..."
fly deploy --app "$APP" --strategy canary --wait-timeout 120
HEALTH_URL="https://${APP}.fly.dev${HEALTH_PATH}"
HEALTHY=false
DEADLINE=$((SECONDS + 60))
while [ $SECONDS -lt $DEADLINE ]; do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$HEALTH_URL" || true)
[ "$STATUS" = "200" ] && HEALTHY=true && break
sleep 3
done
if [ "$HEALTHY" = true ]; then
echo "✅ Canary healthy! Promoting..."
fly deploy --app "$APP" --strategy rolling
echo "🎉 Production deploy complete"
else
echo "❌ Canary failed! Rolling back..."
fly releases rollback --app "$APP"
echo "⏪ Rolled back"
exit 1
fi
Guidelines
- Use
auto_stop_machines = "stop"for dev/staging to save costs; machines stop after idle timeout. - Keep
auto_start_machines = trueso machines wake on incoming requests with sub-second cold start. - Use
.internalDNS for service-to-service calls; never expose internal services publicly. - Store persistent data on volumes, not the machine filesystem, since machines are ephemeral.
- Use LiteFS for SQLite apps needing multi-region reads; it is simpler than PostgreSQL replication.
- Set health checks with realistic timeouts; Fly Proxy uses them for routing, not just monitoring.
- Use
fly-replayheader for write operations in multi-region setups to route to the primary region.