1. Install flyctl
curl -L https://fly.io/install.sh | sh
2. Create fly.toml
app = "my-justapi-app"
primary_region = "iad"
[build]
image = "my-justapi-app:latest"
[http_service]
internal_port = 8080
force_https = true
[[services]]
protocol = "tcp"
internal_port = 8080
[[services.ports]]
port = 80
handlers = ["http"]
[[services.ports]]
port = 443
handlers = ["tls", "http"]
3. Launch
flyctl launch
flyctl deploy
4. Scale
flyctl scale count 3
flyctl scale memory 512
5. Attach Database
flyctl postgres create
flyctl postgres attach my-justapi-app
See Also