# Use the official lightweight Python image. FROM python:3.9-slim # Set the working directory to /app WORKDIR /app # Copy the requirements file into the container COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the file into the working directory COPY . . # Set up Gradio environment variables so it runs accurately within Docker ENV GRADIO_SERVER_NAME="0.0.0.0" ENV GRADIO_SERVER_PORT=7860 # Expose port required for Gradio EXPOSE 7860 # Command to run the application CMD ["python", "app.py"]