Background tasks use synchronous psycopg2 for database writes after analysis completion. Without this package, analyses stayed stuck on "pending" status in Docker deployments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
732 B
Docker
24 lines
732 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libgl1 libglib2.0-0 curl git && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy dependency spec first for layer caching
|
|
COPY pyproject.toml .
|
|
|
|
# Install dependencies (non-editable, just deps)
|
|
RUN pip install --no-cache-dir . && \
|
|
pip install --no-cache-dir psycopg2-binary einops ftfy regex && \
|
|
pip install --no-cache-dir "clip @ git+https://github.com/openai/CLIP.git" && \
|
|
pip install --no-cache-dir "deepgaze-pytorch @ git+https://github.com/matthias-k/DeepGaze.git"
|
|
|
|
# Copy application source
|
|
COPY . .
|
|
|
|
RUN mkdir -p data/uploads
|
|
|
|
EXPOSE 8000
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|