CoolFace
Apppublic

Berzelius255/Computer-Vision-Agri-App

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
Dockerfile41 linesDownload Raw Back to root
1# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker2# you will also find guides on how best to write your Dockerfile3 4FROM python:3.95 6RUN useradd -m -u 1000 user7USER user8ENV PATH="/home/user/.local/bin:$PATH"9 10WORKDIR /app11 12# Copy application files13COPY app.py .14COPY models/best.pt ./models/best.pt15 16COPY --chown=user ./requirements.txt requirements.txt17RUN pip install --no-cache-dir --upgrade -r requirements.txt18 19# Install system dependencies for OpenCV, Ollama, and supervisord20RUN apt-get update && apt-get install -y \21    libgl1-mesa-glx \22    libglib2.0-0 \23    curl \24    supervisor \25    && rm -rf /var/lib/apt/lists/*26 27# Install Ollama28RUN curl -fsSL https://ollama.ai/install.sh | sh && \29    apt-get clean && rm -rf /var/lib/apt/lists/*30 31COPY --chown=user . /app32 33# Expose port 8501 for Streamlit34EXPOSE 850135 36# Health check for Streamlit37HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \38    CMD curl --fail http://localhost:8501/_stcore/health || exit 139 40# Start Streamlit41ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]