Spaces:
Sleeping
Sleeping
| # Use a Python 3.10 base image | |
| FROM python:3.10 | |
| # Set the working directory | |
| WORKDIR /app | |
| # Install essential dependencies for OpenCV | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxrender1 | |
| # Set Hugging Face cache directory to a writable location | |
| ENV HF_HOME /app/.cache | |
| # Set a writable config directory for Ultralytics | |
| ENV YOLO_CONFIG_DIR /app/.config/ultralytics | |
| # Set a writable cache directory for Matplotlib | |
| ENV MPLCONFIGDIR /app/.config/matplotlib | |
| # Copy all project files into the Docker image | |
| COPY . /app | |
| # Install all Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose the port your app will run on in Hugging Face | |
| EXPOSE 7860 | |
| # Command to run the Streamlit app directly | |
| CMD ["streamlit", "run", "model.py", "--server.port", "7860", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--browser.gatherUsageStats", "false"] | |