Spaces:
Sleeping
Sleeping
Commit ·
8a73c37
1
Parent(s): 904573d
Fix: Inline config in CMD (no chmod needed)
Browse files- Dockerfile +2 -6
- start.sh +0 -35
Dockerfile
CHANGED
|
@@ -1,15 +1,11 @@
|
|
| 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 |
-
#
|
| 12 |
-
|
| 13 |
-
RUN chmod +x /start.sh
|
| 14 |
-
|
| 15 |
-
CMD ["/start.sh"]
|
|
|
|
| 1 |
# Imagen oficial de OpenClaw
|
| 2 |
FROM ghcr.io/openclaw/openclaw:latest
|
| 3 |
|
|
|
|
| 4 |
ENV OPENCLAW_GATEWAY_PORT=7860
|
| 5 |
ENV GATEWAY_BIND_MODE=lan
|
| 6 |
ENV NODE_ENV=production
|
| 7 |
|
| 8 |
EXPOSE 7860
|
| 9 |
|
| 10 |
+
# Todo inline: crear config + arrancar gateway
|
| 11 |
+
CMD ["sh", "-c", "mkdir -p /home/node/.openclaw && printf '[gateway]\nbind = \"lan\"\nport = 7860\nmode = \"local\"\n' > /home/node/.openclaw/settings.toml && cat /home/node/.openclaw/settings.toml && exec node dist/index.js gateway --allow-unconfigured"]
|
|
|
|
|
|
|
|
|
start.sh
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|