File size: 1,073 Bytes
e3eae4d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#  Dockerfile for Hugging Face Space: Streamlit + RDKit + PyG

FROM python:3.10-slim

#  system libraries (needed by RDKit / Pillow) 
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        libxrender1 \
        libxext6 \
        libsm6 \
        libx11-6 \
        libglib2.0-0 \
        libfreetype6 \
        libpng-dev \
        wget && \
    rm -rf /var/lib/apt/lists/*
    
#  Python packages 
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir \
        streamlit==1.45.0 \
        rdkit-pypi==2022.9.5 \
        pandas==2.2.3 \
        numpy==1.26.4 \
        torch==2.2.0 \
        torch-geometric==2.5.2 \
        ogb==1.3.6 \
        pillow==10.3.0
    
#  working directory & app code 
WORKDIR /app
COPY . .
    
#  Streamlit configuration for Spaces 
ENV \
    STREAMLIT_SERVER_HEADLESS=true \
    STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
    STREAMLIT_SERVER_PORT=7860 \
    STREAMLIT_TELEMETRY_DISABLED=true
    
EXPOSE 7860
    
#  launch 
CMD ["streamlit", "run", "app.py"]