diff --git a/Dockerfile.dev b/Dockerfile.dev index eeda066..3c3f5f7 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -32,13 +32,21 @@ set -e # Check if the venv has a working Python (catches cross-platform mismatch) if ! /app/backend/.venv/bin/python -c "import sys" 2>/dev/null; then echo "[dev-entrypoint] Installing dependencies (venv missing or incompatible)..." - rm -rf /app/backend/.venv - cd /app/backend && uv sync && uv pip install "watchdog[watchmedo]" + # Docker named volumes can't always be rm -rf'd, so try rm first and warn if it fails + rm_err_file="$(mktemp)" + if ! rm -rf /app/backend/.venv 2>"$rm_err_file"; then + echo "[dev-entrypoint] Warning: failed to remove /app/backend/.venv; continuing with 'uv venv --clear'." >&2 + cat "$rm_err_file" >&2 + fi + rm -f "$rm_err_file" + cd /app/backend && uv venv --clear && uv sync && uv pip install "watchdog[watchmedo]" echo "[dev-entrypoint] Dependencies installed." else # Venv works — run uv sync to pick up any new/changed dependencies echo "[dev-entrypoint] Syncing dependencies..." - cd /app/backend && uv sync --quiet 2>/dev/null || true + if ! (cd /app/backend && uv sync --quiet); then + echo "[dev-entrypoint] Warning: dependency sync failed; continuing with existing environment." >&2 + fi # Ensure watchmedo is there too if ! command -v watchmedo >/dev/null 2>&1; then cd /app/backend && uv pip install "watchdog[watchmedo]"