Skip to content

Fly.io

Fly.io runs Docker containers on edge servers worldwide with built-in TLS and persistent volumes.

Terminal window
# macOS / Linux
curl -L https://fly.io/install.sh | sh
# Windows
pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"
Terminal window
fly auth login

Add this to the repo root:

app = "wcp"
primary_region = "fra" # Frankfurt — change to your nearest region
[build]
dockerfile = "Dockerfile"
[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
[checks]
[checks.health]
type = "http"
port = 8000
path = "/health"
interval = "30s"
timeout = "5s"
[mounts]
source = "wcp_data"
destination = "/data"
[env]
WCP_DB_PATH = "/data/sync.db"
WCP_CONFIG_PATH = "/data/config.json"
Terminal window
fly launch --no-deploy
Terminal window
fly volumes create wcp_data --region fra --size 1
Terminal window
fly secrets set WCP_CORS_ORIGINS=https://your-dashboard.fly.dev
Terminal window
fly deploy

Your instance is live at https://wcp.fly.dev.

Terminal window
# Scale to 2 machines for high availability
fly scale count 2
# Scale memory
fly scale memory 512

Deploy the dashboard as a separate Fly app:

Terminal window
cd dashboard
fly launch --name wcp-dashboard

Set VITE_API_URL to https://wcp.fly.dev before building.