fix: handle Docker named volume for .venv in dev entrypoint#36
fix: handle Docker named volume for .venv in dev entrypoint#36xprilion merged 4 commits intoxprilion:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Improves the dev Docker entrypoint’s resilience when .venv is backed by a Docker named volume (common on ARM64/Raspberry Pi), avoiding crash-loops caused by attempting to rm -rf a mounted volume directory.
Changes:
- Make
.venvcleanup tolerant of Docker named volumes by ignoringrm -rffailure and clearing viauv venv --clear. - Add a “sync dependencies” step when the venv is already valid.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Venv exists and works, but ensure watchmedo is there too | ||
| # 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 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the dev Docker entrypoint to avoid crash-loops when .venv is mounted as a Docker named volume (where deleting the mountpoint directory fails), ensuring dependencies can still be reinstalled/cleared reliably in dev setups (including ARM64).
Changes:
- Capture and warn on failures when attempting to
rm -rf /app/backend/.venv, then fall back touv venv --clearto clear the environment without removing the directory. - Add a best-effort
uv syncon startup when an existing venv is detected as working. - Keep
watchmedoinstallation as a guard when missing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|



Closes #35
Description
When running the dev Docker setup on ARM64 (Raspberry Pi) or any system where
.venvis mounted as a Docker named volume, the entrypoint fails becauserm -rf /app/backend/.venvreturnsDevice or resource busy.Docker named volumes cannot be removed with
rm -rf— the directory persists in the volume store. This causes the dev environment to crash-loop on container start.Fix
rm -rf /app/backend/.venvfirst (works for bind mounts / plain directories)uv venv --clearwhich clears contents without removing the directory — works on Docker volumesTesting