FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y \ libopencv-dev \ build-essential \ python3-opencv \ && apt-get clean COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir \ -r requirements.txt # fastapi \ # uvicorn \ # gradio \ # python-multipart \ # rdkit \ # Pillow \ # numpy \ # matplotlib \ # scipy \ # opencv-python \ # onnx \ # onnxruntime \ # pandas \ # tqdm \ # scikit-image \ # SmilesPE \ # paddleocr==2.9.1 \ # paddlepaddle==2.6.2 \ # torch==2.0.1 \ # torchvision==0.15.2 \ # -i https://pypi.tuna.tsinghua.edu.cn/simple # Set working directory WORKDIR /app # Copy application files # COPY model.py . COPY app.py . # Expose port for Hugging Face Spaces (7860 is default) EXPOSE 7860 # Command to run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]