File size: 822 Bytes
dd79a40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f721d39
dd79a40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11-slim

# System deps for GDAL/geopandas
RUN apt-get update && apt-get install -y --no-install-recommends \
    libgdal-dev \
    gdal-bin \
    libgeos-dev \
    libproj-dev \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY data_pipeline.py .
COPY dashboard_helpers.py .
COPY app.py .

# Pre-download databases so it's baked into the image
RUN python -c "import leafmap; \
    leafmap.download_file( \
        'https://opengeos.org/data/duckdb/nyc_data.db.zip', \
        unzip=True, \
        overwrite=True \
    )"
RUN python data_pipeline.py

# Expose the port HF Spaces expects
EXPOSE 7860

# Launch Solara
CMD ["solara", "run", "app.py", "--host=0.0.0.0", "--port=7860"]