# Use a lightweight Python image FROM python:3.10-slim # Set up a new user to avoid running as root RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # Copy your local files (app.py and requirements.txt) into the container COPY --chown=user . . # Install the dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose the port Gradio uses EXPOSE 7860 # Command to start the app CMD ["python", "app.py"] ENV GRADIO_SSR_MODE=False