Spaces:
Sleeping
Sleeping
| # Use official lightweight Python image | |
| FROM python:3.10-slim | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| TF_CPP_MIN_LOG_LEVEL=2 \ | |
| HF_HOME=/app/huggingface_cache \ | |
| CUDA_VISIBLE_DEVICES="" | |
| # Create app directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install dependencies | |
| COPY requirements.txt . | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # Copy the model and inference script | |
| COPY . . | |
| # Expose port for inference | |
| EXPOSE 8501 | |
| # Run the app | |
| CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |