Spaces:
Sleeping
Sleeping
File size: 942 Bytes
ee1d6a8 2191baf 189e99d 7b1fce6 972c0bb ee1d6a8 3c385ed ee1d6a8 3c385ed ee1d6a8 adf9c6b 972c0bb |
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 |
# 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"]
|