# use the official Python image as the base image FROM python:3.9 # set the working directory in the container WORKDIR /app # set up as a user RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # copy requirements file into the container COPY --chown=user ./requirements.txt requirements.txt # install the dependencies RUN pip install --user --no-cache-dir -r requirements.txt # copy rest of application code COPY --chown=user . . # start the app on port 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]