# Use a lightweight Python image FROM python:3-slim WORKDIR /usr/src/app # Install git and clean up to keep the image small RUN apt-get update && \ apt-get install -y git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Copy everything and set permissions COPY . . # Install required dependencies RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Make sft script executable RUN chmod +x /usr/local/bin/sft # Set full write permissions for current directory RUN chmod -R 777 . # Set cache environment variables to use current directory ENV XDG_CACHE_HOME=./cache # Start gradio application EXPOSE 7860 ENV GRADIO_SERVER_NAME="0.0.0.0" CMD ["python", "app.py"]