FROM python:3.9 # Create a user and set up environment RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" 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 RUN pip install python-multipart # Copy the application code into the container COPY --chown=user . /app # Command to run the FastAPI app using Uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]