@deftai/directive-content 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/deft/SKILL.md +6 -0
- package/.agents/skills/deft-directive-article-review/SKILL.md +11 -0
- package/.agents/skills/deft-directive-build/SKILL.md +10 -0
- package/.agents/skills/deft-directive-cost/SKILL.md +12 -0
- package/.agents/skills/deft-directive-debug/SKILL.md +13 -0
- package/.agents/skills/deft-directive-gh-arch/SKILL.md +11 -0
- package/.agents/skills/deft-directive-gh-slice/SKILL.md +10 -0
- package/.agents/skills/deft-directive-glossary/SKILL.md +10 -0
- package/.agents/skills/deft-directive-interview/SKILL.md +9 -0
- package/.agents/skills/deft-directive-pre-pr/SKILL.md +9 -0
- package/.agents/skills/deft-directive-refinement/SKILL.md +10 -0
- package/.agents/skills/deft-directive-release/SKILL.md +12 -0
- package/.agents/skills/deft-directive-review-cycle/SKILL.md +10 -0
- package/.agents/skills/deft-directive-setup/SKILL.md +10 -0
- package/.agents/skills/deft-directive-swarm/SKILL.md +10 -0
- package/.agents/skills/deft-directive-sync/SKILL.md +9 -0
- package/.agents/skills/deft-directive-triage/SKILL.md +9 -0
- package/.agents/skills/deft-directive-write-skill/SKILL.md +9 -0
- package/LICENSE.md +22 -0
- package/QUICK-START.md +167 -0
- package/UPGRADING.md +517 -0
- package/coding/build-output.md +28 -0
- package/coding/coding.md +235 -0
- package/coding/debugging.md +110 -0
- package/coding/holzmann.md +96 -0
- package/coding/hygiene.md +127 -0
- package/coding/security.md +158 -0
- package/coding/testing.md +162 -0
- package/coding/toolchain.md +44 -0
- package/commands.md +300 -0
- package/context/context.md +57 -0
- package/context/deterministic-split.md +67 -0
- package/context/examples.md +26 -0
- package/context/fractal-summaries.md +69 -0
- package/context/long-horizon.md +46 -0
- package/context/spec-deltas.md +177 -0
- package/context/tool-design.md +34 -0
- package/context/working-memory.md +62 -0
- package/contracts/boundary-maps.md +65 -0
- package/contracts/deterministic-questions.md +59 -0
- package/contracts/hierarchy.md +77 -0
- package/conventions/content-manifest.json +399 -0
- package/conventions/machine-generated-banner.md +130 -0
- package/conventions/references.md +120 -0
- package/conventions/rule-ownership.json +382 -0
- package/conventions/task-caching.md +43 -0
- package/conventions/vbrief-filenames.md +70 -0
- package/deployments/README.md +37 -0
- package/deployments/agentuity/README.md +138 -0
- package/deployments/agentuity/via-cli.md +380 -0
- package/deployments/agentuity/via-cloud.md +425 -0
- package/deployments/agentuity/via-github-actions.md +664 -0
- package/deployments/agentuity/via-gravity-network.md +606 -0
- package/deployments/agentuity/via-vpc.md +607 -0
- package/deployments/aws/README.md +38 -0
- package/deployments/aws/via-app-runner.md +612 -0
- package/deployments/aws/via-ecs-fargate.md +561 -0
- package/deployments/aws/via-elastic-beanstalk.md +628 -0
- package/deployments/aws/via-lambda.md +649 -0
- package/deployments/azure/README.md +37 -0
- package/deployments/azure/via-aks.md +390 -0
- package/deployments/azure/via-app-service.md +564 -0
- package/deployments/azure/via-container-apps.md +599 -0
- package/deployments/azure/via-functions.md +552 -0
- package/deployments/cloud-gov/README.md +63 -0
- package/deployments/cloud-gov/agents/compliance-docs.md +154 -0
- package/deployments/cloud-gov/agents.md +39 -0
- package/deployments/cloud-gov/cicd.md +64 -0
- package/deployments/cloud-gov/deployment.md +150 -0
- package/deployments/cloud-gov/logging.md +43 -0
- package/deployments/cloud-gov/manifest.md +121 -0
- package/deployments/cloud-gov/overview.md +58 -0
- package/deployments/cloud-gov/security.md +46 -0
- package/deployments/cloud-gov/services.md +72 -0
- package/deployments/cloud-gov/upstream/README.md +18 -0
- package/deployments/cloudflare/README.md +33 -0
- package/deployments/cloudflare/via-dashboard.md +83 -0
- package/deployments/cloudflare/via-git.md +90 -0
- package/deployments/cloudflare/via-github-actions.md +185 -0
- package/deployments/cloudflare/via-terraform.md +157 -0
- package/deployments/cloudflare/via-wrangler.md +165 -0
- package/deployments/fly-io/README.md +37 -0
- package/deployments/fly-io/via-dockerfile.md +648 -0
- package/deployments/fly-io/via-flyctl.md +653 -0
- package/deployments/fly-io/via-github-actions.md +695 -0
- package/deployments/fly-io/via-multi-region.md +598 -0
- package/deployments/google/README.md +34 -0
- package/deployments/google/via-app-engine.md +42 -0
- package/deployments/google/via-cloud-functions.md +23 -0
- package/deployments/google/via-cloud-run.md +330 -0
- package/deployments/google/via-gke.md +23 -0
- package/deployments/netlify/README.md +99 -0
- package/deployments/netlify/via-cli.md +17 -0
- package/deployments/netlify/via-functions.md +19 -0
- package/deployments/netlify/via-git.md +25 -0
- package/deployments/vercel/README.md +90 -0
- package/deployments/vercel/via-api.md +16 -0
- package/deployments/vercel/via-cli.md +17 -0
- package/deployments/vercel/via-git.md +24 -0
- package/docs/BROWNFIELD.md +179 -0
- package/docs/getting-started.md +137 -0
- package/docs/good-agents-md.md +137 -0
- package/events/README.md +89 -0
- package/events/event-record.schema.json +26 -0
- package/events/registry.json +166 -0
- package/events/registry.schema.json +71 -0
- package/glossary.md +145 -0
- package/incidents/README.md +81 -0
- package/incidents/_template.md +38 -0
- package/interfaces/cli.md +104 -0
- package/interfaces/rest.md +212 -0
- package/interfaces/tui.md +242 -0
- package/interfaces/web.md +123 -0
- package/languages/6502-DASM.md +132 -0
- package/languages/c.md +235 -0
- package/languages/commands.md +23 -0
- package/languages/cpp.md +132 -0
- package/languages/csharp.md +259 -0
- package/languages/dart.md +183 -0
- package/languages/delphi.md +218 -0
- package/languages/elixir.md +208 -0
- package/languages/go.md +78 -0
- package/languages/java.md +278 -0
- package/languages/javascript.md +163 -0
- package/languages/julia.md +175 -0
- package/languages/kotlin.md +193 -0
- package/languages/markdown.md +168 -0
- package/languages/mermaid.md +146 -0
- package/languages/officejs.md +392 -0
- package/languages/python.md +209 -0
- package/languages/r.md +163 -0
- package/languages/rust.md +216 -0
- package/languages/sql.md +216 -0
- package/languages/swift.md +153 -0
- package/languages/typescript.md +132 -0
- package/languages/vba.md +279 -0
- package/languages/vhdl.md +180 -0
- package/languages/visual-basic.md +151 -0
- package/languages/zig.md +196 -0
- package/meta/SOUL.md +27 -0
- package/meta/code-field.md +44 -0
- package/meta/morals.md +40 -0
- package/meta/philosophy.md +39 -0
- package/meta/project.md +49 -0
- package/meta/ralph.md +223 -0
- package/meta/security.md +80 -0
- package/meta/versioning.md +326 -0
- package/package.json +22 -0
- package/packs/lessons/lessons-pack-0.1.json +553 -0
- package/packs/patterns/patterns-pack-0.1.json +57 -0
- package/packs/rules/rules-pack-0.1.json +4767 -0
- package/packs/skills/skills-pack-0.1.json +262 -0
- package/packs/strategies/strategies-pack-0.1.json +167 -0
- package/packs/swarm-spec/swarm-spec-pack-0.1.json +17 -0
- package/patterns/executor-layer-credentials.md +227 -0
- package/patterns/llm-app.md +156 -0
- package/patterns/multi-agent.md +278 -0
- package/patterns/prompt-assembly-layer-ordering.md +154 -0
- package/patterns/role-as-overlay.md +179 -0
- package/platforms/2600.md +137 -0
- package/platforms/unity.md +329 -0
- package/references/composer-skill-porting.md +152 -0
- package/references/cost-models.md +163 -0
- package/references/ip-risk.md +246 -0
- package/references/plain-english-ux.md +275 -0
- package/resilience/context-pruning.md +67 -0
- package/resilience/continue-here.md +62 -0
- package/scm/changelog.md +276 -0
- package/scm/git.md +139 -0
- package/scm/github.md +265 -0
- package/secrets/.gitkeep +0 -0
- package/skills/deft-build/SKILL.md +20 -0
- package/skills/deft-directive-article-review/SKILL.md +156 -0
- package/skills/deft-directive-build/SKILL.md +302 -0
- package/skills/deft-directive-cost/SKILL.md +201 -0
- package/skills/deft-directive-debug/SKILL.md +140 -0
- package/skills/deft-directive-decompose/SKILL.md +96 -0
- package/skills/deft-directive-gh-arch/SKILL.md +160 -0
- package/skills/deft-directive-gh-slice/SKILL.md +199 -0
- package/skills/deft-directive-glossary/SKILL.md +118 -0
- package/skills/deft-directive-interview/SKILL.md +528 -0
- package/skills/deft-directive-pre-pr/SKILL.md +131 -0
- package/skills/deft-directive-probe/SKILL.md +127 -0
- package/skills/deft-directive-refinement/SKILL.md +403 -0
- package/skills/deft-directive-release/SKILL.md +266 -0
- package/skills/deft-directive-review-cycle/SKILL.md +401 -0
- package/skills/deft-directive-setup/SKILL.md +717 -0
- package/skills/deft-directive-swarm/SKILL.md +989 -0
- package/skills/deft-directive-sync/SKILL.md +288 -0
- package/skills/deft-directive-triage/SKILL.md +137 -0
- package/skills/deft-directive-write-skill/SKILL.md +169 -0
- package/skills/deft-interview/SKILL.md +16 -0
- package/skills/deft-pre-pr/SKILL.md +16 -0
- package/skills/deft-review-cycle/SKILL.md +16 -0
- package/skills/deft-roadmap-refresh/SKILL.md +16 -0
- package/skills/deft-setup/SKILL.md +20 -0
- package/skills/deft-swarm/SKILL.md +16 -0
- package/skills/deft-sync/SKILL.md +16 -0
- package/strategies/README.md +83 -0
- package/strategies/artifact-guards.md +85 -0
- package/strategies/bdd.md +115 -0
- package/strategies/brownfield.md +7 -0
- package/strategies/discuss.md +129 -0
- package/strategies/emit-hints.md +69 -0
- package/strategies/enterprise.md +193 -0
- package/strategies/interview.md +551 -0
- package/strategies/map.md +179 -0
- package/strategies/probe.md +151 -0
- package/strategies/rapid.md +155 -0
- package/strategies/research.md +155 -0
- package/strategies/roadmap.md +9 -0
- package/strategies/speckit.md +437 -0
- package/strategies/v0-20-contract.md +134 -0
- package/strategies/yolo.md +169 -0
- package/swarm/swarm.md +300 -0
- package/templates/COST-ESTIMATE.md +114 -0
- package/templates/PULL_REQUEST_TEMPLATE.md +35 -0
- package/templates/agent-prompt-preamble.md +409 -0
- package/templates/agents-entry.md +211 -0
- package/templates/agents-entry.placeholders.md +75 -0
- package/templates/embed.go +20 -0
- package/templates/embed_test.go +36 -0
- package/templates/make-spec-example.md +9 -0
- package/templates/make-spec.md +246 -0
- package/templates/project.md.template +52 -0
- package/templates/specification.md +1 -0
- package/templates/swarm-greptile-poller-prompt.md +556 -0
- package/templates/user.md.template +31 -0
- package/tools/RWLDL.md +80 -0
- package/tools/greptile.md +141 -0
- package/tools/installer.md +23 -0
- package/tools/taskfile-migration.md +32 -0
- package/tools/taskfile.md +185 -0
- package/tools/telemetry.md +285 -0
- package/vbrief/schemas/cache-meta.schema.json +137 -0
- package/vbrief/schemas/candidates.schema.json +130 -0
- package/vbrief/schemas/codebase-map.schema.json +213 -0
- package/vbrief/schemas/lessons-pack.schema.json +134 -0
- package/vbrief/schemas/patterns-pack.schema.json +84 -0
- package/vbrief/schemas/rules-pack.schema.json +105 -0
- package/vbrief/schemas/skills-pack.schema.json +94 -0
- package/vbrief/schemas/slices.schema.json +87 -0
- package/vbrief/schemas/strategies-pack.schema.json +89 -0
- package/vbrief/schemas/swarm-spec-pack.schema.json +84 -0
- package/vbrief/schemas/vbrief-core.schema.json +1022 -0
- package/vbrief/vbrief.md +684 -0
- package/verification/integration.md +76 -0
- package/verification/plan-checking.md +85 -0
- package/verification/uat.md +60 -0
- package/verification/verification.md +117 -0
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
# Deploy via flyctl CLI
|
|
2
|
+
|
|
3
|
+
The primary and recommended method for deploying applications to Fly.io. The `flyctl` CLI provides complete control over your applications from creation through scaling and monitoring.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`flyctl` (or `fly`) is Fly.io's command-line tool that enables:
|
|
8
|
+
- **App Deployment**: Deploy containers from source or Dockerfile
|
|
9
|
+
- **Configuration Management**: Manage fly.toml and secrets
|
|
10
|
+
- **Multi-Region Deployment**: Deploy globally with one command
|
|
11
|
+
- **Real-Time Monitoring**: View logs, metrics, and status
|
|
12
|
+
- **Database Management**: Create and manage Fly Postgres
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### macOS
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Using Homebrew
|
|
20
|
+
brew install flyctl
|
|
21
|
+
|
|
22
|
+
# Or using install script
|
|
23
|
+
curl -L https://fly.io/install.sh | sh
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Linux
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Install script
|
|
30
|
+
curl -L https://fly.io/install.sh | sh
|
|
31
|
+
|
|
32
|
+
# Add to PATH
|
|
33
|
+
export FLYCTL_INSTALL="/home/user/.fly"
|
|
34
|
+
export PATH="$FLYCTL_INSTALL/bin:$PATH"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Windows (PowerShell)
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
# Run in PowerShell
|
|
41
|
+
iwr https://fly.io/install.ps1 -useb | iex
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Verify Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
flyctl version
|
|
48
|
+
fly version # 'fly' is an alias for 'flyctl'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
### 1. Sign Up / Login
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Create account and login
|
|
57
|
+
fly auth signup
|
|
58
|
+
|
|
59
|
+
# Or login to existing account
|
|
60
|
+
fly auth login
|
|
61
|
+
|
|
62
|
+
# Verify authentication
|
|
63
|
+
fly auth whoami
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Launch Your First App
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Navigate to your project directory
|
|
70
|
+
cd my-app
|
|
71
|
+
|
|
72
|
+
# Launch app (interactive setup)
|
|
73
|
+
fly launch
|
|
74
|
+
|
|
75
|
+
# This will:
|
|
76
|
+
# - Detect your app type
|
|
77
|
+
# - Generate fly.toml configuration
|
|
78
|
+
# - Create a Dockerfile if needed
|
|
79
|
+
# - Deploy your app
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Deploy Updates
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Deploy changes
|
|
86
|
+
fly deploy
|
|
87
|
+
|
|
88
|
+
# Deploy with specific Dockerfile
|
|
89
|
+
fly deploy --dockerfile Dockerfile.production
|
|
90
|
+
|
|
91
|
+
# Deploy with remote builder (no local Docker needed)
|
|
92
|
+
fly deploy --remote-only
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Core Commands
|
|
96
|
+
|
|
97
|
+
### Application Management
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Create new app
|
|
101
|
+
fly apps create my-app
|
|
102
|
+
|
|
103
|
+
# List your apps
|
|
104
|
+
fly apps list
|
|
105
|
+
|
|
106
|
+
# Show app status
|
|
107
|
+
fly status
|
|
108
|
+
|
|
109
|
+
# Open app in browser
|
|
110
|
+
fly open
|
|
111
|
+
|
|
112
|
+
# Destroy app
|
|
113
|
+
fly apps destroy my-app
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Deployment
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Standard deployment
|
|
120
|
+
fly deploy
|
|
121
|
+
|
|
122
|
+
# Deploy from specific directory
|
|
123
|
+
fly deploy --config /path/to/fly.toml
|
|
124
|
+
|
|
125
|
+
# Deploy with build arguments
|
|
126
|
+
fly deploy --build-arg API_VERSION=v2
|
|
127
|
+
|
|
128
|
+
# Deploy specific image
|
|
129
|
+
fly deploy --image registry.example.com/my-app:latest
|
|
130
|
+
|
|
131
|
+
# No cache build
|
|
132
|
+
fly deploy --no-cache
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Configuration
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# View current configuration
|
|
139
|
+
fly config show
|
|
140
|
+
|
|
141
|
+
# Edit configuration
|
|
142
|
+
fly config edit
|
|
143
|
+
|
|
144
|
+
# Validate fly.toml
|
|
145
|
+
fly config validate
|
|
146
|
+
|
|
147
|
+
# Save current config
|
|
148
|
+
fly config save
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Secrets Management
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Set secret
|
|
155
|
+
fly secrets set DATABASE_URL=postgres://...
|
|
156
|
+
|
|
157
|
+
# Set multiple secrets
|
|
158
|
+
fly secrets set API_KEY=abc123 SECRET_TOKEN=xyz789
|
|
159
|
+
|
|
160
|
+
# Import secrets from file
|
|
161
|
+
fly secrets import < .env.production
|
|
162
|
+
|
|
163
|
+
# List secrets (values hidden)
|
|
164
|
+
fly secrets list
|
|
165
|
+
|
|
166
|
+
# Remove secret
|
|
167
|
+
fly secrets unset API_KEY
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Scaling
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Show current scale
|
|
174
|
+
fly scale show
|
|
175
|
+
|
|
176
|
+
# Scale machine count
|
|
177
|
+
fly scale count 3
|
|
178
|
+
|
|
179
|
+
# Scale to specific regions
|
|
180
|
+
fly scale count 2 --region iad,lhr
|
|
181
|
+
|
|
182
|
+
# Scale machine size
|
|
183
|
+
fly scale vm shared-cpu-2x
|
|
184
|
+
|
|
185
|
+
# Scale memory
|
|
186
|
+
fly scale memory 512
|
|
187
|
+
|
|
188
|
+
# Autoscaling
|
|
189
|
+
fly autoscale set min=1 max=10
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Regions & Multi-Region
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# List available regions
|
|
196
|
+
fly platform regions
|
|
197
|
+
|
|
198
|
+
# Add region
|
|
199
|
+
fly regions add lhr # London
|
|
200
|
+
|
|
201
|
+
# Remove region
|
|
202
|
+
fly regions remove lhr
|
|
203
|
+
|
|
204
|
+
# Set backup region
|
|
205
|
+
fly regions backup iad
|
|
206
|
+
|
|
207
|
+
# Deploy to multiple regions
|
|
208
|
+
fly scale count 3 --region iad,lhr,syd
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## fly.toml Configuration
|
|
212
|
+
|
|
213
|
+
### Basic Configuration
|
|
214
|
+
|
|
215
|
+
```toml
|
|
216
|
+
# Application name
|
|
217
|
+
app = "my-app"
|
|
218
|
+
|
|
219
|
+
# Primary region
|
|
220
|
+
primary_region = "iad"
|
|
221
|
+
|
|
222
|
+
# Build configuration
|
|
223
|
+
[build]
|
|
224
|
+
dockerfile = "Dockerfile"
|
|
225
|
+
# Or use buildpacks
|
|
226
|
+
# builder = "paketobuildpacks/builder:base"
|
|
227
|
+
|
|
228
|
+
# Environment variables
|
|
229
|
+
[env]
|
|
230
|
+
NODE_ENV = "production"
|
|
231
|
+
PORT = "8080"
|
|
232
|
+
|
|
233
|
+
# HTTP service
|
|
234
|
+
[[services]]
|
|
235
|
+
protocol = "tcp"
|
|
236
|
+
internal_port = 8080
|
|
237
|
+
|
|
238
|
+
[[services.ports]]
|
|
239
|
+
port = 80
|
|
240
|
+
handlers = ["http"]
|
|
241
|
+
|
|
242
|
+
[[services.ports]]
|
|
243
|
+
port = 443
|
|
244
|
+
handlers = ["http", "tls"]
|
|
245
|
+
|
|
246
|
+
# Health checks
|
|
247
|
+
[services.http_checks]
|
|
248
|
+
interval = "10s"
|
|
249
|
+
timeout = "2s"
|
|
250
|
+
grace_period = "5s"
|
|
251
|
+
method = "GET"
|
|
252
|
+
path = "/health"
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Advanced Configuration
|
|
256
|
+
|
|
257
|
+
```toml
|
|
258
|
+
app = "advanced-app"
|
|
259
|
+
primary_region = "iad"
|
|
260
|
+
|
|
261
|
+
# Autoscaling
|
|
262
|
+
[autoscaling]
|
|
263
|
+
min_machines = 1
|
|
264
|
+
max_machines = 10
|
|
265
|
+
|
|
266
|
+
# Processes (multiple process types)
|
|
267
|
+
[processes]
|
|
268
|
+
web = "npm run start"
|
|
269
|
+
worker = "npm run worker"
|
|
270
|
+
|
|
271
|
+
# Metrics
|
|
272
|
+
[metrics]
|
|
273
|
+
port = 9091
|
|
274
|
+
path = "/metrics"
|
|
275
|
+
|
|
276
|
+
# Volumes
|
|
277
|
+
[mounts]
|
|
278
|
+
source = "data"
|
|
279
|
+
destination = "/data"
|
|
280
|
+
|
|
281
|
+
# Private network
|
|
282
|
+
[private_network]
|
|
283
|
+
name = "my-app-net"
|
|
284
|
+
|
|
285
|
+
# Deploy configuration
|
|
286
|
+
[deploy]
|
|
287
|
+
release_command = "npm run migrate"
|
|
288
|
+
strategy = "rolling"
|
|
289
|
+
|
|
290
|
+
[deploy.max_unavailable]
|
|
291
|
+
count = 1
|
|
292
|
+
|
|
293
|
+
# HTTP service with caching
|
|
294
|
+
[[services]]
|
|
295
|
+
internal_port = 8080
|
|
296
|
+
protocol = "tcp"
|
|
297
|
+
|
|
298
|
+
[[services.ports]]
|
|
299
|
+
handlers = ["http"]
|
|
300
|
+
port = 80
|
|
301
|
+
force_https = true
|
|
302
|
+
|
|
303
|
+
[[services.ports]]
|
|
304
|
+
handlers = ["tls", "http"]
|
|
305
|
+
port = 443
|
|
306
|
+
|
|
307
|
+
# Concurrency limits
|
|
308
|
+
[services.concurrency]
|
|
309
|
+
type = "connections"
|
|
310
|
+
hard_limit = 200
|
|
311
|
+
soft_limit = 100
|
|
312
|
+
|
|
313
|
+
# TCP checks
|
|
314
|
+
[[services.tcp_checks]]
|
|
315
|
+
interval = "15s"
|
|
316
|
+
timeout = "2s"
|
|
317
|
+
grace_period = "5s"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Advanced Features
|
|
321
|
+
|
|
322
|
+
### Fly Machines API
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# List machines
|
|
326
|
+
fly machines list
|
|
327
|
+
|
|
328
|
+
# Create machine
|
|
329
|
+
fly machines run nginx
|
|
330
|
+
|
|
331
|
+
# Stop machine
|
|
332
|
+
fly machines stop MACHINE_ID
|
|
333
|
+
|
|
334
|
+
# Start machine
|
|
335
|
+
fly machines start MACHINE_ID
|
|
336
|
+
|
|
337
|
+
# Clone machine
|
|
338
|
+
fly machines clone MACHINE_ID
|
|
339
|
+
|
|
340
|
+
# Remove machine
|
|
341
|
+
fly machines remove MACHINE_ID
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Volumes (Persistent Storage)
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
# Create volume
|
|
348
|
+
fly volumes create data --region iad --size 10
|
|
349
|
+
|
|
350
|
+
# List volumes
|
|
351
|
+
fly volumes list
|
|
352
|
+
|
|
353
|
+
# Extend volume
|
|
354
|
+
fly volumes extend VOLUME_ID --size 20
|
|
355
|
+
|
|
356
|
+
# Snapshot volume
|
|
357
|
+
fly volumes snapshots create VOLUME_ID
|
|
358
|
+
|
|
359
|
+
# Restore from snapshot
|
|
360
|
+
fly volumes create data --snapshot-id SNAPSHOT_ID
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Postgres Database
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Create Postgres cluster
|
|
367
|
+
fly postgres create
|
|
368
|
+
|
|
369
|
+
# Attach to app
|
|
370
|
+
fly postgres attach MY_POSTGRES_APP
|
|
371
|
+
|
|
372
|
+
# Connect to database
|
|
373
|
+
fly postgres connect
|
|
374
|
+
|
|
375
|
+
# List databases
|
|
376
|
+
fly postgres db list
|
|
377
|
+
|
|
378
|
+
# Create database
|
|
379
|
+
fly postgres db create mydb
|
|
380
|
+
|
|
381
|
+
# Show connection string
|
|
382
|
+
fly postgres config show
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Private Networking
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# Create private network
|
|
389
|
+
fly wireguard create
|
|
390
|
+
|
|
391
|
+
# Add peer
|
|
392
|
+
fly wireguard peer add
|
|
393
|
+
|
|
394
|
+
# List peers
|
|
395
|
+
fly wireguard list
|
|
396
|
+
|
|
397
|
+
# Connect via WireGuard
|
|
398
|
+
fly proxy 5432:5432 -a my-postgres-app
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### SSH & Console Access
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# SSH into running instance
|
|
405
|
+
fly ssh console
|
|
406
|
+
|
|
407
|
+
# SSH with specific command
|
|
408
|
+
fly ssh console -C "ls -la"
|
|
409
|
+
|
|
410
|
+
# Open Rails console
|
|
411
|
+
fly ssh console --pty -C "rails console"
|
|
412
|
+
|
|
413
|
+
# Run one-off command
|
|
414
|
+
fly ssh console -C "bin/rails db:migrate"
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
## Monitoring & Debugging
|
|
418
|
+
|
|
419
|
+
### Logs
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
# Stream logs
|
|
423
|
+
fly logs
|
|
424
|
+
|
|
425
|
+
# Filter by region
|
|
426
|
+
fly logs --region iad
|
|
427
|
+
|
|
428
|
+
# Show specific number of lines
|
|
429
|
+
fly logs -n 100
|
|
430
|
+
|
|
431
|
+
# Search logs
|
|
432
|
+
fly logs | grep ERROR
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Metrics & Monitoring
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
# Open Grafana dashboard
|
|
439
|
+
fly dashboard
|
|
440
|
+
|
|
441
|
+
# Show metrics
|
|
442
|
+
fly dashboard metrics
|
|
443
|
+
|
|
444
|
+
# VM status
|
|
445
|
+
fly status --all
|
|
446
|
+
|
|
447
|
+
# Check health
|
|
448
|
+
fly checks list
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Debugging
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
# View deployment history
|
|
455
|
+
fly releases
|
|
456
|
+
|
|
457
|
+
# Rollback to previous version
|
|
458
|
+
fly releases rollback
|
|
459
|
+
|
|
460
|
+
# Show app info
|
|
461
|
+
fly info
|
|
462
|
+
|
|
463
|
+
# Check app health
|
|
464
|
+
fly status
|
|
465
|
+
|
|
466
|
+
# Test connectivity
|
|
467
|
+
fly ping
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## Deployment Strategies
|
|
471
|
+
|
|
472
|
+
### Blue-Green Deployment
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
# Deploy new version
|
|
476
|
+
fly deploy --strategy bluegreen
|
|
477
|
+
|
|
478
|
+
# Or configure in fly.toml
|
|
479
|
+
[deploy]
|
|
480
|
+
strategy = "bluegreen"
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Canary Deployment
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
# Deploy to limited machines first
|
|
487
|
+
fly deploy --strategy canary
|
|
488
|
+
|
|
489
|
+
# Manual canary
|
|
490
|
+
fly scale count 1 --region iad # Deploy to one region
|
|
491
|
+
# Verify, then scale up
|
|
492
|
+
fly scale count 3 --region iad,lhr,syd
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### Rolling Deployment
|
|
496
|
+
|
|
497
|
+
```toml
|
|
498
|
+
# fly.toml
|
|
499
|
+
[deploy]
|
|
500
|
+
strategy = "rolling"
|
|
501
|
+
max_unavailable = 1 # One at a time
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
## Best Practices
|
|
505
|
+
|
|
506
|
+
### 1. Use fly.toml in Version Control
|
|
507
|
+
|
|
508
|
+
```bash
|
|
509
|
+
# Generate fly.toml
|
|
510
|
+
fly launch --no-deploy
|
|
511
|
+
|
|
512
|
+
# Commit to git
|
|
513
|
+
git add fly.toml
|
|
514
|
+
git commit -m "Add Fly.io configuration"
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### 2. Manage Secrets Properly
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
# Never commit secrets to git
|
|
521
|
+
echo ".env" >> .gitignore
|
|
522
|
+
|
|
523
|
+
# Use fly secrets for production
|
|
524
|
+
fly secrets set $(cat .env.production | xargs)
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### 3. Health Checks
|
|
528
|
+
|
|
529
|
+
```toml
|
|
530
|
+
[[services]]
|
|
531
|
+
# Always configure health checks
|
|
532
|
+
[[services.http_checks]]
|
|
533
|
+
interval = "10s"
|
|
534
|
+
timeout = "2s"
|
|
535
|
+
method = "GET"
|
|
536
|
+
path = "/health"
|
|
537
|
+
protocol = "http"
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
### 4. Multi-Region for High Availability
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
# Deploy to multiple regions
|
|
544
|
+
fly regions add iad lhr syd
|
|
545
|
+
|
|
546
|
+
# Verify distribution
|
|
547
|
+
fly status --all
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
### 5. Use Volumes for Persistent Data
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
# Create volume before first deploy
|
|
554
|
+
fly volumes create data --region iad
|
|
555
|
+
|
|
556
|
+
# Mount in fly.toml
|
|
557
|
+
[mounts]
|
|
558
|
+
source = "data"
|
|
559
|
+
destination = "/data"
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
## Troubleshooting
|
|
563
|
+
|
|
564
|
+
### Deployment Fails
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
# Check build logs
|
|
568
|
+
fly logs --timestamps
|
|
569
|
+
|
|
570
|
+
# Deploy with verbose output
|
|
571
|
+
fly deploy --verbose
|
|
572
|
+
|
|
573
|
+
# Check app status
|
|
574
|
+
fly status
|
|
575
|
+
|
|
576
|
+
# View recent events
|
|
577
|
+
fly events
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
### App Not Responding
|
|
581
|
+
|
|
582
|
+
```bash
|
|
583
|
+
# Check if instances are running
|
|
584
|
+
fly status --all
|
|
585
|
+
|
|
586
|
+
# Restart all instances
|
|
587
|
+
fly restart
|
|
588
|
+
|
|
589
|
+
# Scale up
|
|
590
|
+
fly scale count 2
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### Connection Issues
|
|
594
|
+
|
|
595
|
+
```bash
|
|
596
|
+
# Test DNS
|
|
597
|
+
dig my-app.fly.dev
|
|
598
|
+
|
|
599
|
+
# Check certificates
|
|
600
|
+
fly certs show
|
|
601
|
+
|
|
602
|
+
# Verify routing
|
|
603
|
+
fly ips list
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### High Memory Usage
|
|
607
|
+
|
|
608
|
+
```bash
|
|
609
|
+
# Check current usage
|
|
610
|
+
fly status
|
|
611
|
+
|
|
612
|
+
# Scale memory
|
|
613
|
+
fly scale memory 1024
|
|
614
|
+
|
|
615
|
+
# Or upgrade VM
|
|
616
|
+
fly scale vm dedicated-cpu-2x
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
## Common Workflows
|
|
620
|
+
|
|
621
|
+
### Deploy from CI/CD
|
|
622
|
+
|
|
623
|
+
```bash
|
|
624
|
+
# Non-interactive deploy
|
|
625
|
+
fly deploy --remote-only --now
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Database Migration
|
|
629
|
+
|
|
630
|
+
```bash
|
|
631
|
+
# Run migration before deployment
|
|
632
|
+
[deploy]
|
|
633
|
+
release_command = "rails db:migrate"
|
|
634
|
+
|
|
635
|
+
# Or manually
|
|
636
|
+
fly ssh console -C "npm run migrate"
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
### Environment-Specific Deployments
|
|
640
|
+
|
|
641
|
+
```bash
|
|
642
|
+
# Use different fly.toml files
|
|
643
|
+
fly deploy --config fly.staging.toml
|
|
644
|
+
fly deploy --config fly.production.toml
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
## References
|
|
648
|
+
|
|
649
|
+
- [flyctl CLI Reference](https://fly.io/docs/flyctl/)
|
|
650
|
+
- [fly.toml Configuration](https://fly.io/docs/reference/configuration/)
|
|
651
|
+
- [Deployment Guide](https://fly.io/docs/reference/deployment/)
|
|
652
|
+
- [Fly Machines](https://fly.io/docs/machines/)
|
|
653
|
+
- [Troubleshooting](https://fly.io/docs/getting-started/troubleshooting/)
|