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/textIf 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", "cities", "bureaus", "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 Cities
City frontends and apps should call the Node block through @downcity/city:
import { City } from "@downcity/federation/legacy";
const city = new City({
federation_url: "https://base.example.com",
user_token: "user_token",
});Trusted backends should use FederationAdmin with an administrator session token:
import { FederationAdmin } from "@downcity/federation/legacy";
const admin = new FederationAdmin({
base_url: "https://base.example.com",
credential: administrator_session_token,
});See User City and FederationAdmin for the full SDK surface.