File size: 1,335 Bytes
0b1ac45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 1. Use Python 3.10 (Standard for HF Spaces)
FROM python:3.10-slim

WORKDIR /app

# 2. Install System Dependencies
# Required for Cartopy (maps) and Git (for installing from source)
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    libgeos-dev \
    libproj-dev \
    proj-bin \
    && rm -rf /var/lib/apt/lists/*

# 3. CRITICAL: Install NATTEN from Pre-built Wheels
# If we don't do this, pip tries to compile it from source (takes 20+ mins) and fails.
# We match the CUDA version (cu121) and Python version (cp310).
RUN pip install natten==0.17.3 -f https://shi-labs.com/natten/wheels/cu121/

# 4. CRITICAL: Install Earth2Studio from GitHub
# We use the [stormscope] tag to tell it we have the dependencies ready.
RUN pip install "earth2studio[stormscope] @ git+https://github.com/NVIDIA/earth2studio.git"

# 5. Install Other Python Dependencies
# (Streamlit, Maps, etc.)
RUN pip install \
    streamlit \
    torch \
    torchvision \
    numpy \
    matplotlib \
    cartopy \
    huggingface_hub \
    scipy

# 6. Copy App Code
COPY . .

# 7. Launch App
CMD ["streamlit", "run", "app.py", \
     "--server.port", "7860", \
     "--server.address", "0.0.0.0", \
     "--server.enableCORS", "false", \
     "--server.enableXsrfProtection", "false", \
     "--server.fileWatcherType", "none"]