Buckets:
| set -e | |
| DATA_DIR="/data" | |
| CODE_SERVER_ARGS=(--bind-addr 0.0.0.0:7860 --auth password) | |
| if [ -w "$DATA_DIR" ]; then | |
| echo "[entrypoint] Storage bucket detected at /data — persisting the entire home directory." | |
| PERSIST_HOME="$DATA_DIR/home" | |
| mkdir -p "$PERSIST_HOME" | |
| # First run only: seed the persistent home with whatever was baked into the | |
| # image (.bashrc, .profile, default dotfiles, etc.) without clobbering | |
| # anything already saved there from a previous session. | |
| if [ -z "$(ls -A "$PERSIST_HOME" 2>/dev/null)" ]; then | |
| cp -a "$HOME"/. "$PERSIST_HOME"/ 2>/dev/null || true | |
| fi | |
| export HOME="$PERSIST_HOME" | |
| else | |
| echo "[entrypoint] No storage bucket attached at /data — running with EPHEMERAL storage." | |
| echo "[entrypoint] Everything in your home directory will be lost on restart." | |
| echo "[entrypoint] Attach a Storage Bucket at mount path /data in your Space settings to persist it." | |
| fi | |
| mkdir -p "$HOME/workspace" | |
| cd "$HOME" | |
| exec code-server "${CODE_SERVER_ARGS[@]}" "$HOME/workspace" | |
Xet Storage Details
- Size:
- 1.03 kB
- Xet hash:
- 0e6152ba94c8758c3c315d5eb4cd31137d5cc378ea50cf3a798ac21b1fe3be87
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.