Spaces:
Sleeping
Sleeping
| # Dockerfile for AI Background Changer | |
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| git \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application files | |
| COPY . . | |
| # Create necessary directories with permissions | |
| RUN mkdir -p uploads results models && chmod -R 777 uploads results models | |
| # Download SAM model if not present (optional - you have it locally) | |
| # RUN if [ ! -f models/sam_vit_b_01ec64.pth ]; then \ | |
| # wget -P models/ https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth; \ | |
| # fi | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run application | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |