test / Dockerfile
NS-Genai's picture
Upload 3 files
0b1ac45 verified
# 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"]