File size: 850 Bytes
5d39246 4913d55 4d5d5db 4913d55 2d903ec 4913d55 5d39246 4913d55 5d39246 4913d55 b7b2793 | 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 | FROM python:3.10-slim
# Prevent python cache files
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# HuggingFace model cache location
ENV HF_HOME=/tmp/hf
ENV TRANSFORMERS_CACHE=/tmp/hf
ENV HF_HUB_DISABLE_TELEMETRY=1
WORKDIR /app
# Install system dependencies needed for RDKit / scientific stack
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (improves Docker layer caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY . .
# HuggingFace Spaces uses port 7860
EXPOSE 7860
# --preload loads models once instead of per worker
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |