# Base Python image FROM python:3.9-slim # Set working directory in container WORKDIR /app # Copy requirements and install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all local files to container working directory COPY . . # Create 'flagged' directory with write permissions for Gradio RUN mkdir /app/flagged && chmod 777 /app/flagged # Expose the port Gradio uses EXPOSE 7860 # Set environment variable for Gradio to listen on all interfaces ENV GRADIO_SERVER_NAME="0.0.0.0" # Command to run the app CMD ["python", "app.py"]