Files
rehearshalhub/api/Dockerfile
Mistral Vibe 1a260a5f58 fix: add alembic files to development Docker image and fix database configuration
- Added COPY commands for alembic.ini and alembic/ directory in development Dockerfile
- Updated alembic.ini to use correct database credentials for Docker environment
- Fixed database URL to point to 'db' host instead of 'localhost'
- Updated password to match docker-compose environment variables

These changes resolve the database startup issues where:
1. Alembic migrations couldn't run because files were missing from container
2. Database connection failed due to incorrect credentials
3. API couldn't start because required tables didn't exist

Now the full development environment starts properly with:
- Database migrations running automatically
- API connecting to database successfully
- UI accessible on port 3000
- API accessible on port 8000
2026-04-08 15:49:58 +02:00

29 lines
959 B
Docker

FROM python:3.12-slim AS base
WORKDIR /app
RUN pip install uv
FROM python:3.12-slim AS development
WORKDIR /app
COPY pyproject.toml .
COPY src/ src/
COPY alembic.ini .
COPY alembic/ alembic/
# Install directly into system Python — no venv, so uvicorn's multiprocessing.spawn
# subprocess inherits the same interpreter and can always find rehearsalhub
RUN pip install --no-cache-dir -e "."
# ./api/src is mounted as a volume at runtime; the editable .pth file points here
CMD ["python3", "-m", "uvicorn", "rehearsalhub.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
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"]