File size: 2,954 Bytes
978fed5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ============================================================================
# SciDER — Multi-agent research automation system
#
# Base: NVIDIA CUDA (for PyTorch GPU support)
# Includes: texlive-full (LaTeX compilation), uv (Python package manager)
# ============================================================================

FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    DEBIAN_FRONTEND=noninteractive \
    # uv installs to ~/.local/bin by default
    PATH="/root/.local/bin:$PATH"

# --------------------------------------------------------------------------
# System dependencies
# --------------------------------------------------------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
    # Build tools & basics
    build-essential \
    curl \
    git \
    # Python 3.12
    python3.12 \
    python3.12-dev \
    python3.12-venv \
    # LaTeX (full distribution for PaperOrchestra compilation)
    texlive-full \
    && rm -rf /var/lib/apt/lists/*

# --------------------------------------------------------------------------
# Install uv
# --------------------------------------------------------------------------
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

# --------------------------------------------------------------------------
# Copy project metadata first (for layer caching)
# --------------------------------------------------------------------------
COPY pyproject.toml uv.lock /app/

# --------------------------------------------------------------------------
# Install Python dependencies via uv
#   --extra cu128     : PyTorch with CUDA 12.8 support
#   --extra streamlit : Streamlit frontend dependencies
# --------------------------------------------------------------------------
RUN uv sync --extra cu128 --extra streamlit --no-dev --no-cache

# --------------------------------------------------------------------------
# Copy application code
# --------------------------------------------------------------------------
COPY scider/ /app/scider/
COPY .scider/ /app/.scider/
COPY model_settings/ /app/model_settings/
COPY streamlit-client/ /app/streamlit-client/
COPY static/ /app/static/
# Case studies for browse-only mode (no API key needed)
COPY case-study-memory/ /app/streamlit-client/case-study-memory/

# --------------------------------------------------------------------------
# Runtime setup
# --------------------------------------------------------------------------
RUN mkdir -p workspace

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
    CMD curl --fail http://localhost:7860/_stcore/health || exit 1

CMD ["uv", "run", "streamlit", "run", "streamlit-client/app.py", \
     "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true", \
     "--server.enableXsrfProtection=false", "--browser.gatherUsageStats=false"]