Files
rehearshalhub/api/Dockerfile
Mistral Vibe a8cbd333d2 Fix dev container startup for both API and web
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 <noreply@anthropic.com>
2026-04-06 19:14:21 +02:00

26 lines
817 B
Docker

FROM python:3.12-slim AS base
WORKDIR /app
RUN pip install uv
FROM base AS development
# 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", "--reload-dir", "/app/src"]
FROM base AS lint
COPY pyproject.toml .
RUN uv sync --frozen
COPY src/ src/
RUN uv run ruff check src/ && uv run mypy src/
FROM base AS production
COPY pyproject.toml .
RUN uv sync --no-dev --frozen || uv sync --no-dev
COPY . .
ENTRYPOINT ["sh", "entrypoint.sh"]
CMD ["uv", "run", "uvicorn", "rehearsalhub.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "2"]