Spaces:
Sleeping
Sleeping
Fix: Corregir script de inicio
Browse files- Dockerfile +7 -48
Dockerfile
CHANGED
|
@@ -1,62 +1,21 @@
|
|
| 1 |
FROM node:22-slim
|
| 2 |
|
| 3 |
-
# Dependencias del sistema
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
git openssh-client build-essential python3 ca-certificates \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
# Instalar OpenClaw via npm
|
| 9 |
RUN npm install -g openclaw@latest --force --unsafe-perm
|
| 10 |
|
| 11 |
-
# Variables de entorno
|
| 12 |
ENV PORT=7860 \
|
| 13 |
OPENCLAW_GATEWAY_MODE=local \
|
| 14 |
HOME=/root
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
# Generar openclaw.json\n\
|
| 22 |
-
cat > /root/.openclaw/openclaw.json <<EOF\n\
|
| 23 |
-
{\n\
|
| 24 |
-
"models": {\n\
|
| 25 |
-
"providers": {\n\
|
| 26 |
-
"9router": {\n\
|
| 27 |
-
"baseUrl": "https://rraiir8.9router.com/v1",\n\
|
| 28 |
-
"apiKey": "sk-f773b5beecaa4c15-9c7byl-7290844a",\n\
|
| 29 |
-
"api": "openai-completions",\n\
|
| 30 |
-
"models": [{ "id": "combo/free-combo", "name": "Kimi Combo (9Router)", "contextWindow": 128000 }]\n\
|
| 31 |
-
}\n\
|
| 32 |
-
}\n\
|
| 33 |
-
},\n\
|
| 34 |
-
"agents": { "defaults": { "model": { "primary": "9router/combo/free-combo" } } },\n\
|
| 35 |
-
"channels": {\n\
|
| 36 |
-
"telegram": {\n\
|
| 37 |
-
"type": "telegram",\n\
|
| 38 |
-
"botToken": "${TELEGRAM_BOT_TOKEN}",\n\
|
| 39 |
-
"enabled": true\n\
|
| 40 |
-
}\n\
|
| 41 |
-
},\n\
|
| 42 |
-
"gateway": {\n\
|
| 43 |
-
"mode": "local", \"bind\": \"lan\", \"port\": ${PORT},\n\
|
| 44 |
-
\"trustedProxies\": [\"0.0.0.0/0\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\"],\n\
|
| 45 |
-
\"auth\": { \"mode\": \"token\", \"token\": \"${OPENCLAW_GATEWAY_PASSWORD}\" },\n\
|
| 46 |
-
\"controlUi\": { \"allowInsecureAuth\": true }\n\
|
| 47 |
-
}\n\
|
| 48 |
-
}\n\
|
| 49 |
-
EOF\n\
|
| 50 |
-
\n\
|
| 51 |
-
echo "=== Config Generada ==="\n\
|
| 52 |
-
cat /root/.openclaw/openclaw.json\n\
|
| 53 |
-
echo "======================="\n\
|
| 54 |
-
\n\
|
| 55 |
-
# Intentar arreglar permisos si es necesario\n\
|
| 56 |
-
openclaw doctor --fix || true\n\
|
| 57 |
-
\n\
|
| 58 |
-
# Arrancar gateway\n\
|
| 59 |
-
exec openclaw gateway run --port $PORT\n' > /usr/local/bin/start-openclaw && chmod +x /usr/local/bin/start-openclaw
|
| 60 |
|
| 61 |
EXPOSE 7860
|
| 62 |
-
|
|
|
|
|
|
| 1 |
FROM node:22-slim
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 4 |
git openssh-client build-essential python3 ca-certificates \
|
| 5 |
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
|
|
|
|
| 7 |
RUN npm install -g openclaw@latest --force --unsafe-perm
|
| 8 |
|
|
|
|
| 9 |
ENV PORT=7860 \
|
| 10 |
OPENCLAW_GATEWAY_MODE=local \
|
| 11 |
HOME=/root
|
| 12 |
|
| 13 |
+
RUN mkdir -p /root/.openclaw/sessions
|
| 14 |
+
|
| 15 |
+
RUN echo '{"models":{"providers":{"9router":{"baseUrl":"https://rraiir8.9router.com/v1","apiKey":"sk-f773b5beecaa4c15-9c7byl-7290844a","api":"openai-completions","models":[{"id":"combo/free-combo","name":"Kimi Combo (9Router)","contextWindow":128000}]}}},"agents":{"defaults":{"model":{"primary":"9router/combo/free-combo"}}},"channels":{"telegram":{"type":"telegram","botToken":"'${TELEGRAM_BOT_TOKEN}'","enabled":false}},"gateway":{"mode":"local","bind":"lan","port":'${PORT}',"trustedProxies":["0.0.0.0/0","10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"],"auth":{"mode":"token","token":"'${OPENCLAW_GATEWAY_PASSWORD}'"},"controlUi":{"allowInsecureAuth":true}}}' > /root/.openclaw/openclaw.json
|
| 16 |
+
|
| 17 |
+
RUN openclaw doctor --fix || true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
CMD ["sh", "-c", "exec openclaw gateway run --port $PORT"]
|