# FROM python:3.10 # RUN useradd -m -u 1000 user # USER user # ENV HOME=/home/user \ # PATH=/home/user/.local/bin:$PATH # WORKDIR $HOME/app # COPY --chown=user . $HOME/app # COPY ./requirements.txt ~/app/requirements.txt # RUN pip install --upgrade pip # RUN pip install -r requirements.txt # COPY . . # CMD ["chainlitdocker buildx build .", "run", "app.py", "--port", "7860"] FROM python:3.10-slim # Create a non-root user RUN useradd -m -u 1000 user USER user # Set environment variables ENV HOME=/home/user ENV PATH=/home/user/.local/bin:$PATH # Set working directory WORKDIR $HOME/app # Copy requirements file COPY --chown=user . $HOME/app COPY ./requirements.txt $HOME/app/requirements.txt # Upgrade pip and install dependencies RUN pip install --timeout=100 --index-url https://pypi.org/simple --upgrade pip RUN pip install --timeout=100 --index-url https://pypi.org/simple -r requirements.txt # Copy the rest of the application files COPY . . # Set the entrypoint command CMD ["chainlit", "run", "app.py", "--port", "7860"]