Spaces:
Runtime error
Runtime error
| # Base image with Python | |
| FROM python:3.11-slim | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE 1 | |
| ENV PYTHONUNBUFFERED 1 | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy the requirements file | |
| COPY requirements.txt /app/ | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Install system dependencies individually | |
| RUN apt-get update && apt-get install -y libgl1-mesa-glx | |
| RUN apt-get install -y libglib2.0-0 | |
| RUN apt-get install -y libsm6 | |
| RUN apt-get install -y libxrender1 | |
| RUN apt-get install -y libxext6 | |
| RUN apt-get install -y ffmpeg | |
| # Clean up apt cache | |
| RUN apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Copy the application code | |
| COPY . /app/ | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Start the application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |