# Use the official Python 3.10 image from the Docker Hub FROM python:3.10 # Install necessary system dependencies RUN apt-get update && apt-get install -y \ libgl1-mesa-glx \ && rm -rf /var/lib/apt/lists/* # Create a new user and set permissions RUN useradd -m -u 1000 user USER user # Set environment variables ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory WORKDIR $HOME/app # Copy the requirements file and install dependencies COPY --chown=user requirements.txt $HOME/app/requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code COPY --chown=user . . # Define the command to run your Chainlit application CMD ["chainlit", "run", "app.py", "--port", "7860"]