Submatter/docker/worker-entrypoint.sh

18 lines
560 B
Bash
Raw Normal View History

#!/bin/sh
set -eu
# When OpenHands is enabled, seed the shared workspace volume from the deploy
# snapshot baked into the image (/app/repo). Agent-server reads the same path.
if [ "${WORKER_SESSION_TYPE:-minimal}" = "openhands" ]; then
target="${WORKER_OPENHANDS_WORKSPACE:-/workspace/repo}"
mkdir -p "$(dirname "$target")"
if [ ! -f "$target/pnpm-workspace.yaml" ]; then
echo "[worker-entrypoint] seeding OpenHands workspace at ${target}"
mkdir -p "$target"
cp -a /app/repo/. "$target/"
fi
fi
cd /app/apps/worker
exec node dist/index.js