File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,13 +32,21 @@ set -e
3232# Check if the venv has a working Python (catches cross-platform mismatch)
3333if ! /app/backend/.venv/bin/python -c "import sys" 2>/dev/null; then
3434 echo "[dev-entrypoint] Installing dependencies (venv missing or incompatible)..."
35- rm -rf /app/backend/.venv
36- cd /app/backend && uv sync && uv pip install "watchdog[watchmedo]"
35+ # Docker named volumes can't always be rm -rf'd, so try rm first and warn if it fails
36+ rm_err_file="$(mktemp)"
37+ if ! rm -rf /app/backend/.venv 2>"$rm_err_file"; then
38+ echo "[dev-entrypoint] Warning: failed to remove /app/backend/.venv; continuing with 'uv venv --clear'." >&2
39+ cat "$rm_err_file" >&2
40+ fi
41+ rm -f "$rm_err_file"
42+ cd /app/backend && uv venv --clear && uv sync && uv pip install "watchdog[watchmedo]"
3743 echo "[dev-entrypoint] Dependencies installed."
3844else
3945 # Venv works — run uv sync to pick up any new/changed dependencies
4046 echo "[dev-entrypoint] Syncing dependencies..."
41- cd /app/backend && uv sync --quiet 2>/dev/null || true
47+ if ! (cd /app/backend && uv sync --quiet); then
48+ echo "[dev-entrypoint] Warning: dependency sync failed; continuing with existing environment." >&2
49+ fi
4250 # Ensure watchmedo is there too
4351 if ! command -v watchmedo >/dev/null 2>&1; then
4452 cd /app/backend && uv pip install "watchdog[watchmedo]"
You can’t perform that action at this time.
0 commit comments