traffic-scene / Dockerfile
0xdivin3's picture
Upload 8 files
72534cf verified
Raw
History Blame Contribute Delete
892 Bytes
# Dockerfile for Hugging Face Spaces (Docker SDK).
# Hugging Face Spaces no longer supports Streamlit as a native built-in SDK,
# so Streamlit apps run inside a small Docker container instead. This file
# does exactly what "streamlit run app.py" does locally, just packaged so
# Hugging Face knows how to build and start it.
FROM python:3.10-slim
WORKDIR /app
# System libraries OpenCV sometimes needs even in "headless" mode.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Hugging Face Spaces expects the app to listen on port 7860 by default
# for Docker-based Spaces (set via app_port in the Space's README.md).
EXPOSE 7860
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]