2026-06-10 12:25:30 -08:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
{
|
|
|
|
|
project.name = "openclaw";
|
|
|
|
|
|
|
|
|
|
services = {
|
2026-06-14 02:30:13 -08:00
|
|
|
gateway = {
|
|
|
|
|
service = {
|
|
|
|
|
image = "node:22-alpine";
|
|
|
|
|
container_name = "openclaw-gateway";
|
|
|
|
|
restart = "unless-stopped";
|
|
|
|
|
network_mode = "host";
|
|
|
|
|
volumes = [
|
|
|
|
|
"/var/openclaw/gateway:/app"
|
|
|
|
|
"/root/.openclaw:/root/.openclaw"
|
|
|
|
|
];
|
|
|
|
|
environment = {
|
|
|
|
|
OPENCLAW_HOME = "/root/.openclaw";
|
|
|
|
|
};
|
|
|
|
|
command = [
|
|
|
|
|
"sh" "-c"
|
|
|
|
|
''
|
|
|
|
|
set -e
|
|
|
|
|
if [ ! -f /app/node_modules/.bin/openclaw ]; then
|
|
|
|
|
cd /app && npm install openclaw@latest
|
|
|
|
|
fi
|
2026-06-14 02:36:21 -08:00
|
|
|
exec /app/node_modules/.bin/openclaw gateway --port 18789 --dev --auth none
|
2026-06-14 02:30:13 -08:00
|
|
|
''
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-10 12:25:30 -08:00
|
|
|
app = {
|
|
|
|
|
service = {
|
2026-06-14 02:30:13 -08:00
|
|
|
image = "node:22-alpine";
|
2026-06-10 12:25:30 -08:00
|
|
|
container_name = "openclaw";
|
|
|
|
|
restart = "unless-stopped";
|
2026-06-14 02:30:13 -08:00
|
|
|
network_mode = "host";
|
2026-06-10 12:25:30 -08:00
|
|
|
volumes = [
|
|
|
|
|
"/var/openclaw/app:/app"
|
|
|
|
|
"/root/.openclaw:/root/.openclaw:ro"
|
|
|
|
|
];
|
|
|
|
|
environment = {
|
|
|
|
|
PORT = "4310";
|
2026-06-14 02:30:13 -08:00
|
|
|
UI_BIND_ADDRESS = "127.0.0.1";
|
2026-06-10 12:25:30 -08:00
|
|
|
OPENCLAW_HOME = "/root/.openclaw";
|
|
|
|
|
};
|
|
|
|
|
command = [
|
|
|
|
|
"sh" "-c"
|
|
|
|
|
''
|
|
|
|
|
set -e
|
|
|
|
|
apk add --no-cache git
|
|
|
|
|
if [ ! -d /app/repo ]; then
|
|
|
|
|
git clone https://github.com/TianyiDataScience/openclaw-control-center.git /app/repo
|
|
|
|
|
fi
|
|
|
|
|
cd /app/repo
|
|
|
|
|
if [ ! -f .env ]; then
|
|
|
|
|
cp .env.example .env
|
|
|
|
|
sed -i "s|OPENCLAW_HOME=.*|OPENCLAW_HOME=/root/.openclaw|" .env
|
|
|
|
|
sed -i "s|PORT=.*|PORT=4310|" .env
|
|
|
|
|
fi
|
2026-06-14 02:13:31 -08:00
|
|
|
sed -i 's/resolveUiLanguage(url.searchParams, "zh")/resolveUiLanguage(url.searchParams, "en")/g' src/ui/server.ts
|
|
|
|
|
sed -i 's/hasExplicitLanguage ? resolvedLanguage : "zh"/hasExplicitLanguage ? resolvedLanguage : "en"/g' src/ui/server.ts
|
|
|
|
|
sed -i 's/language: "zh",/language: "en",/g' src/runtime/ui-preferences.ts
|
2026-06-10 12:25:30 -08:00
|
|
|
npm install
|
|
|
|
|
npm run build
|
|
|
|
|
exec npm run dev:ui
|
|
|
|
|
''
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|