|
ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04" |
|
FROM nvidia/cuda:${CUDA_IMAGE} |
|
|
|
|
|
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/* |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt /app/ |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . /app |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
COPY --chown=user . $HOME/app |
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
ENV NAME World |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] |