AccidentAI / Dockerfile
krupal02's picture
Upload Dockerfile with huggingface_hub
a8133bd verified
Raw
History Blame Contribute Delete
705 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies for OpenCV
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libxcb1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Install CPU-only PyTorch (keeps image small)
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
# Install ultralytics (YOLO)
RUN pip install ultralytics
COPY . .
EXPOSE 7860
# Run Streamlit (default for HF Spaces)
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]