Fly.io
Fly.io runs Docker containers on edge servers worldwide with built-in TLS and persistent volumes.
1. Install flyctl
Section titled “1. Install flyctl”# macOS / Linuxcurl -L https://fly.io/install.sh | sh
# Windowspwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"fly auth login2. Create fly.toml
Section titled “2. Create fly.toml”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"3. Launch
Section titled “3. Launch”fly launch --no-deploy4. Create the Volume
Section titled “4. Create the Volume”fly volumes create wcp_data --region fra --size 15. Set Secrets
Section titled “5. Set Secrets”fly secrets set WCP_CORS_ORIGINS=https://your-dashboard.fly.dev6. Deploy
Section titled “6. Deploy”fly deployYour instance is live at https://wcp.fly.dev.
Scaling
Section titled “Scaling”# Scale to 2 machines for high availabilityfly scale count 2
# Scale memoryfly scale memory 512Dashboard
Section titled “Dashboard”Deploy the dashboard as a separate Fly app:
cd dashboardfly launch --name wcp-dashboardSet VITE_API_URL to https://wcp.fly.dev before building.