-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (21 loc) · 967 Bytes
/
Dockerfile
File metadata and controls
26 lines (21 loc) · 967 Bytes
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
FROM python:3.13-slim
WORKDIR /app
# Install system deps for numpy/torch
RUN apt-get update && apt-get install -y --no-install-recommends gcc g++ && rm -rf /var/lib/apt/lists/*
# Install Python dependencies first (layer caching)
# Install CPU-only PyTorch first to avoid pulling ~2GB CUDA libs
COPY pyproject.toml ./
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir .
# Copy source code
COPY main.py ./
COPY data/ ./data/
COPY backend/ ./backend/
COPY alembic/ ./alembic/
COPY artifacts/ ./artifacts/
COPY tests/ ./tests/
COPY README.md MODEL_ARCHITECTURE.md ./
EXPOSE 8501
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8501/_stcore/health')" || exit 1
CMD ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true", "--browser.gatherUsageStats=false"]