FROM python:3.10-slim | |
# Set environment variables | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
ENV PYTHONUNBUFFERED=1 | |
# Create working directory | |
WORKDIR /app | |
# Install system dependencies (FIX FOR YOUR ERROR) | |
RUN apt-get update && apt-get install -y \ | |
libglib2.0-0 libgl1-mesa-glx \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy app files | |
COPY . . | |
# Run FastAPI with uvicorn | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |