# Use the official Python image from the Docker Hub FROM python:3.9 # Create a user and set the working directory RUN useradd -m -u 1000 user 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 COPY --chown=user . /app # Set the entry point to run the FastAPI server CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]