Create start.sh
Browse files
start.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# --- Persistence Setup ---
|
| 4 |
+
# Hugging Face mounts persistent storage at /data
|
| 5 |
+
# If /data exists (meaning storage is attached), we link our app data there
|
| 6 |
+
if [ -d "/data" ]; then
|
| 7 |
+
echo "Persistent storage found at /data. Setting up symlinks..."
|
| 8 |
+
|
| 9 |
+
# Create subfolder for openclaw if it doesn't exist
|
| 10 |
+
mkdir -p /data/openclaw_storage
|
| 11 |
+
|
| 12 |
+
# If the app stores data in a specific folder (e.g., ./data),
|
| 13 |
+
# we point it to the persistent mount
|
| 14 |
+
rm -rf /app/data
|
| 15 |
+
ln -s /data/openclaw_storage /app/data
|
| 16 |
+
|
| 17 |
+
echo "Persistence linked."
|
| 18 |
+
else
|
| 19 |
+
echo "No persistent storage detected. Data will be lost on restart."
|
| 20 |
+
fi
|
| 21 |
+
|
| 22 |
+
# --- Start the Application ---
|
| 23 |
+
# OpenClaw is a Next.js app, start it on HF's required port 7860
|
| 24 |
+
exec npm run start -- -p 7860
|