Simford.Dong commited on
Commit ·
f1fb0ec
1
Parent(s): e793d5e
Fix: add missing dirs, fix perms, and try --host 0.0.0.0
Browse files- Dockerfile +10 -1
Dockerfile
CHANGED
|
@@ -21,6 +21,10 @@ EXPOSE 7860
|
|
| 21 |
RUN echo '#!/bin/bash\n\
|
| 22 |
set -x\n\
|
| 23 |
\n\
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
# Generate minimal config if not exists\n\
|
| 25 |
if [ ! -f /root/.openclaw/openclaw.json ]; then\n\
|
| 26 |
cat > /root/.openclaw/openclaw.json << EOF\n\
|
|
@@ -47,12 +51,17 @@ if [ ! -f /root/.openclaw/openclaw.json ]; then\n\
|
|
| 47 |
EOF\n\
|
| 48 |
fi\n\
|
| 49 |
\n\
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
# Fix config if needed\n\
|
| 51 |
openclaw doctor --fix\n\
|
| 52 |
\n\
|
| 53 |
# Start OpenClaw gateway\n\
|
| 54 |
echo "Starting OpenClaw gateway on port 7860..."\n\
|
| 55 |
-
|
|
|
|
| 56 |
' > /usr/local/bin/start-openclaw && chmod +x /usr/local/bin/start-openclaw
|
| 57 |
|
| 58 |
CMD ["/usr/local/bin/start-openclaw"]
|
|
|
|
| 21 |
RUN echo '#!/bin/bash\n\
|
| 22 |
set -x\n\
|
| 23 |
\n\
|
| 24 |
+
# Create critical missing directories\n\
|
| 25 |
+
mkdir -p /root/.openclaw/agents/main/sessions\n\
|
| 26 |
+
mkdir -p /root/.openclaw/credentials\n\
|
| 27 |
+
\n\
|
| 28 |
# Generate minimal config if not exists\n\
|
| 29 |
if [ ! -f /root/.openclaw/openclaw.json ]; then\n\
|
| 30 |
cat > /root/.openclaw/openclaw.json << EOF\n\
|
|
|
|
| 51 |
EOF\n\
|
| 52 |
fi\n\
|
| 53 |
\n\
|
| 54 |
+
# Fix permissions\n\
|
| 55 |
+
chmod 700 /root/.openclaw\n\
|
| 56 |
+
chmod 600 /root/.openclaw/openclaw.json\n\
|
| 57 |
+
\n\
|
| 58 |
# Fix config if needed\n\
|
| 59 |
openclaw doctor --fix\n\
|
| 60 |
\n\
|
| 61 |
# Start OpenClaw gateway\n\
|
| 62 |
echo "Starting OpenClaw gateway on port 7860..."\n\
|
| 63 |
+
# Try to bind to 0.0.0.0\n\
|
| 64 |
+
exec openclaw gateway run --port 7860 --host 0.0.0.0\n\
|
| 65 |
' > /usr/local/bin/start-openclaw && chmod +x /usr/local/bin/start-openclaw
|
| 66 |
|
| 67 |
CMD ["/usr/local/bin/start-openclaw"]
|