# Base image with Python and necessary tools | |
FROM python:3.12-slim | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the application files to the container | |
COPY . /app | |
# Install Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
ENV TRANSFORMERS_CACHE=/tmp | |
ENV PORT=7860 | |
# Command to run the application | |
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "2"] | |