Deploy With Dokploy
Deploy localfed to Dokploy with persistent SQLite storage.
templates/localfed defaults to local development. The Compose deployment disables Local Account so its credential-free local login cannot be exposed publicly, and stores SQLite data in a persistent /data volume.
Dokploy Settings
Create an app in Dokploy from this Git repository:
| Setting | Value |
|---|---|
| Deployment mode | Compose |
| Compose file | ./docker-compose.yml |
| Container port | 43127 |
| Volume | Compose creates downcity_infra_data |
HOST, PORT, the database path, and the login mode are already defined in docker-compose.yml:
HOST=0.0.0.0
PORT=43127
DATABASE_PATH=/data/downcity.sqlite
LOCAL_LOGIN=false/data must stay persistent. Cities, accounts, and Federation env entries are stored in that SQLite database.
Domain Path
The Node block listens on 43127, and the Federation API is mounted at the service root:
GET /health
POST /v1/env/upsert
GET /v1/services
POST /v1/ai/streamIf your domain is https://base.example.com, product-side SDKs and trusted backends should use:
base_url=https://base.example.comProvider Keys
The localfed template reads DEEPSEEK_API_KEY directly from the process environment. Configure it as a Dokploy secret:
DEEPSEEK_API_KEY=sk-...Verify
After Dokploy finishes the deployment, verify the public service:
curl https://base.example.com/healthWhen using an IP and port:
curl http://1.2.3.4:43127/healthExpected shape:
{
"ok": true,
"services": ["env", "accounts", "ai"]
}If the request times out, the Dokploy service is not exposed publicly, the VPS firewall does not allow 43127, or a reachable domain has not been bound yet.
Call From Federation
Product frontends and apps call Federation through Federation:
import { Federation } from "@downcity/federation";
const federation = new Federation({
url: "https://base.example.com",
user_token: "user_token",
});Trusted backends use the Federation Admin domain with an administrator session token:
import { Federation } from "@downcity/federation";
const federation = new Federation({
url: "https://base.example.com",
admin_token: administrator_session_token,
});See Federation User and Federation Admin for the full SDK surface.