Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies required for OpenCV and MediaPipe | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| libgomp1 \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| ffmpeg \ | |
| libglx-mesa0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set Streamlit configuration | |
| ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt ./ | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # Copy application files | |
| COPY streamlit_app.py ./ | |
| COPY classifier.tflite ./ | |
| # Copy optional images folder if it exists | |
| COPY images/ ./images/ | |
| # Expose Streamlit port | |
| EXPOSE 8501 | |
| # Health check | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health | |
| # Run the Streamlit app | |
| ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |