ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04" FROM nvidia/cuda:${CUDA_IMAGE} # Install Python 3.10 and other necessary packages RUN apt-get update && apt-get install -y \ python3.10 python3-pip \ tesseract-ocr \ libtesseract-dev \ libgl1-mesa-glx \ poppler-utils \ && rm -rf /var/lib/apt/lists/* # Set the working directory in the container to /app WORKDIR /app # Copy the requirements file into the container at /app COPY requirements.txt /app/ # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of your application's code COPY . /app # Create a user to run the application RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory in the user's home directory WORKDIR $HOME/app COPY --chown=user . $HOME/app # Make port 8000 available to the world outside this container EXPOSE 8000 # Define environment variable ENV NAME World # Run the application when the container launches CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]