# Use a Python 3.12 base image FROM python:3.12 # Create a user and set environment variables RUN useradd -m -u 1000 user && \ mkdir -p /home/user/app/files && \ chown -R user:user /home/user/app && \ apt-get update && \ apt-get install -y tesseract-ocr poppler-utils && \ rm -rf /var/lib/apt/lists/* USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory WORKDIR $HOME/app # Copy your application code and requirements.txt COPY --chown=user . . COPY --chown=user requirements.txt $HOME/app/requirements.txt # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Specify the command to run your application CMD ["chainlit", "run", "app.py", "--port", "7860"]