fix(docker): set directory ownership for container user

Add chown commands to set ownership of mounted directories to uid 1000
(the container's node user). This allows the container to write to the
mounted volumes when the host directories are owned by root.

Uses || true to avoid failing when run by non-root users.
This commit is contained in:
{Suksham-sharma} 2026-01-29 01:33:31 +05:30
parent 8f068817ca
commit 7e47d8d9fa

View File

@ -26,6 +26,10 @@ mkdir -p "${CLAWDBOT_WORKSPACE_DIR:-$HOME/clawd}"
export CLAWDBOT_CONFIG_DIR="${CLAWDBOT_CONFIG_DIR:-$HOME/.clawdbot}"
export CLAWDBOT_WORKSPACE_DIR="${CLAWDBOT_WORKSPACE_DIR:-$HOME/clawd}"
# Set ownership to container user (uid 1000) so the container can write to mounted volumes
chown -R 1000:1000 "$CLAWDBOT_CONFIG_DIR" 2>/dev/null || true
chown -R 1000:1000 "$CLAWDBOT_WORKSPACE_DIR" 2>/dev/null || true
export CLAWDBOT_GATEWAY_PORT="${CLAWDBOT_GATEWAY_PORT:-18789}"
export CLAWDBOT_BRIDGE_PORT="${CLAWDBOT_BRIDGE_PORT:-18790}"
export CLAWDBOT_GATEWAY_BIND="${CLAWDBOT_GATEWAY_BIND:-lan}"