FROM python:3.9 # Add a non-root user RUN useradd -m -u 1000 user # Set the working directory WORKDIR /app # Copy the requirements file and install dependencies COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy the application code and the questions.db file COPY --chown=user . /app # Expose the port EXPOSE 7860 # Set the command to run the application CMD ["uvicorn", "app:app", "--no-access-log", "--host", "0.0.0.0", "--port", "7860"]