FROM python:3.10-slim WORKDIR /app # Copy project files COPY . . RUN pip install --no-cache-dir -r requirements.txt # Create the required directory and adjust its ownership RUN mkdir -p /app/.files && chown -R 1000:1000 /app/.files # Create a non-root user and switch to it RUN adduser --disabled-password --gecos '' appuser && chown -R appuser:appuser /app USER appuser EXPOSE 7860 CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]