From a8cbd333d27665287c3a0f08aa50c3918bb4d00e Mon Sep 17 00:00:00 2001 From: Mistral Vibe Date: Mon, 6 Apr 2026 19:14:21 +0200 Subject: [PATCH] Fix dev container startup for both API and web MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API: - Add python symlink (python3-slim has no bare 'python') so uv doesn't invalidate the baked venv on every container start - Copy src/ before uv sync so hatchling installs rehearsalhub as a proper editable install (.pth pointing to /app/src) — previously sync ran with no source present, producing a broken empty wheel - Remove ENV PYTHONPATH workaround (no longer needed with correct install) - Add --reload-dir /app/src to scope uvicorn's file watcher to the mounted source directory Web: - Add COPY . . after npm install so index.html and vite.config.ts are baked into the image — without them Vite ignored port config and fell back to 5173 with no entry point Co-Authored-By: Claude Sonnet 4.6 --- api/Dockerfile | 6 ++++-- web/Dockerfile | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 511b80d..2eb31a7 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -3,11 +3,13 @@ WORKDIR /app RUN pip install uv FROM base AS development -ENV PYTHONPATH=/app/src +# python:3.12-slim has no bare 'python' binary; without this uv invalidates the baked venv on every start +RUN ln -sf /usr/local/bin/python3 /usr/local/bin/python COPY pyproject.toml . +COPY src/ src/ RUN uv sync COPY . . -CMD ["uv", "run", "uvicorn", "rehearsalhub.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] +CMD ["uv", "run", "uvicorn", "rehearsalhub.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-dir", "/app/src"] FROM base AS lint COPY pyproject.toml . diff --git a/web/Dockerfile b/web/Dockerfile index ad6d332..2be93a1 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -2,7 +2,8 @@ FROM node:20-alpine AS development WORKDIR /app COPY package*.json ./ RUN npm install --legacy-peer-deps -# Source is mounted as a volume at runtime — node_modules stays in the image +COPY . . +# ./web/src is mounted as a volume at runtime for HMR; everything else comes from the image CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"] FROM node:20-alpine AS builder