# Use official lightweight Python image FROM python:3.11-slim # Prevent Python from writing pyc files ENV PYTHONDONTWRITEBYTECODE=1 # Prevent Python from buffering stdout/stderr ENV PYTHONUNBUFFERED=1 # Set working directory WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Expose port EXPOSE 7860 # Run app using Gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]