HuggingFaceNYCTaxi / Dockerfile
cmande62's picture
Initial dashboard deployment
5984bfd
raw
history blame contribute delete
967 Bytes
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 and bake the data
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
RUN jupyter trust app.ipynb
# Launch voila
CMD ["voila", "app.ipynb", "--port=7860", "--no-browser", "--Voila.ip=0.0.0.0", "--Voila.tornado_settings={'headers':{'Content-Security-Policy':'frame-ancestors *'}}", "--template=gridstack"]