diff --git a/backend/Dockerfile b/backend/Dockerfile index 8b0882e..2a67133 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -24,7 +24,11 @@ WORKDIR /app # Copy requirements first for better caching COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +# Install PyTorch CPU-only FIRST so open-clip-torch doesn't pull the full +# CUDA build (~7 GB). CPU inference is all we need — the heavy lifting +# happens through ONNX Runtime. +RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu \ + && pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . diff --git a/docker-compose.yml b/docker-compose.yml index 0f243ad..2286b17 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: # Run Alembic migrations before starting uvicorn. On a fresh Postgres # the empty 0001 baseline is a no-op stamp; create_all in init_db then # builds the schema. - command: sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload" + command: sh -c "python -c \"import asyncio; from app.database import init_db; asyncio.run(init_db())\" && alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload" environment: - DATABASE_URL=postgresql+asyncpg://mulita:mulita@db:5432/mulita - REDIS_URL=redis://redis:6379