FROM python:3.9-slim # Install system dependencies RUN apt-get update && \ apt-get install -y build-essential gfortran # Create a non-root user RUN useradd -m -u 1000 user USER user # Set environment variables ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set working directory WORKDIR $HOME/app # Copy requirements file and install dependencies COPY --chown=user . $HOME/app COPY ./requirements.txt $HOME/app/requirements.txt RUN pip install --user -r requirements.txt # Copy application code COPY . . # Command to run the application CMD ["chainlit", "run", "app.py", "--port", "7860"]