# Use an official Python runtime as the base image | |
FROM python:3.9-slim | |
# Set environment variables | |
ENV PYTHONUNBUFFERED=1 | |
# Set the working directory | |
WORKDIR /app | |
# Copy the requirements file and install dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the application code | |
COPY . . | |
# Expose the port Gradio will run on | |
EXPOSE 7860 | |
# Command to run the application | |
CMD ["python", "app.py"] |