Spaces:
Sleeping
Sleeping
Commit ·
904573d
1
Parent(s): c5ef746
Force config via startup script (settings.toml + bind=lan)
Browse files- Dockerfile +7 -10
- start.sh +35 -0
Dockerfile
CHANGED
|
@@ -1,18 +1,15 @@
|
|
| 1 |
# Imagen oficial de OpenClaw
|
| 2 |
FROM ghcr.io/openclaw/openclaw:latest
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
# GATEWAY_BIND_MODE=lan fuerza el binding a 0.0.0.0 (documentación oficial OpenClaw)
|
| 6 |
-
ENV GATEWAY_BIND_MODE=lan
|
| 7 |
ENV OPENCLAW_GATEWAY_PORT=7860
|
| 8 |
-
ENV
|
| 9 |
ENV NODE_ENV=production
|
| 10 |
|
| 11 |
-
# Variables para Kimi 2.5 vía OpenAI-compatible API
|
| 12 |
-
# Se configuran como Secrets en HF para seguridad
|
| 13 |
-
# OPENAI_API_KEY, OPENAI_API_BASE, OPENCLAW_GATEWAY_MODEL
|
| 14 |
-
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Imagen oficial de OpenClaw
|
| 2 |
FROM ghcr.io/openclaw/openclaw:latest
|
| 3 |
|
| 4 |
+
# Variables de entorno base
|
|
|
|
|
|
|
| 5 |
ENV OPENCLAW_GATEWAY_PORT=7860
|
| 6 |
+
ENV GATEWAY_BIND_MODE=lan
|
| 7 |
ENV NODE_ENV=production
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
EXPOSE 7860
|
| 10 |
|
| 11 |
+
# Copiar nuestro script de arranque que FUERZA la configuración
|
| 12 |
+
COPY start.sh /start.sh
|
| 13 |
+
RUN chmod +x /start.sh
|
| 14 |
+
|
| 15 |
+
CMD ["/start.sh"]
|
start.sh
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -e
|
| 3 |
+
|
| 4 |
+
# Crear directorio de config de OpenClaw
|
| 5 |
+
mkdir -p /home/node/.openclaw
|
| 6 |
+
|
| 7 |
+
# Escribir config directamente — esto FUERZA el bind a 0.0.0.0
|
| 8 |
+
cat > /home/node/.openclaw/settings.toml << 'EOF'
|
| 9 |
+
[gateway]
|
| 10 |
+
bind = "lan"
|
| 11 |
+
port = 7860
|
| 12 |
+
mode = "local"
|
| 13 |
+
EOF
|
| 14 |
+
|
| 15 |
+
# Si hay variables de OpenAI, escribirlas en el config
|
| 16 |
+
if [ -n "$OPENAI_API_KEY" ]; then
|
| 17 |
+
cat >> /home/node/.openclaw/settings.toml << EOF
|
| 18 |
+
|
| 19 |
+
[providers.openai]
|
| 20 |
+
apiKey = "$OPENAI_API_KEY"
|
| 21 |
+
baseURL = "${OPENAI_API_BASE:-https://integrate.api.nvidia.com/v1}"
|
| 22 |
+
EOF
|
| 23 |
+
fi
|
| 24 |
+
|
| 25 |
+
# Modelo por defecto
|
| 26 |
+
if [ -n "$OPENCLAW_GATEWAY_MODEL" ]; then
|
| 27 |
+
sed -i "s/mode = \"local\"/mode = \"local\"\nmodel = \"$OPENCLAW_GATEWAY_MODEL\"/" /home/node/.openclaw/settings.toml
|
| 28 |
+
fi
|
| 29 |
+
|
| 30 |
+
echo "=== OpenClaw Config ==="
|
| 31 |
+
cat /home/node/.openclaw/settings.toml
|
| 32 |
+
echo "======================"
|
| 33 |
+
|
| 34 |
+
# Iniciar OpenClaw gateway
|
| 35 |
+
exec node dist/index.js gateway --allow-unconfigured
|