FROM python:3.9 # Use a base image with Python installed FROM python:3.9 # WORKDIR - sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile. WORKDIR /app # Copy the requirements file to the container COPY requirements.txt . # Install the required packages RUN pip install --no-cache-dir -r requirements.txt # Copy the application files to the container COPY . . # Set the command to run when the container starts CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]