|
|
|
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY . /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
tesseract-ocr \ |
|
libtesseract-dev \ |
|
poppler-utils |
|
|
|
|
|
RUN pip install \ |
|
fastapi \ |
|
uvicorn \ |
|
PyMuPDF \ |
|
torch torchvision\ |
|
tensorflow\ |
|
tf-keras\ |
|
flax\ |
|
pytesseract \ |
|
Pillow \ |
|
llama-index \ |
|
transformers |
|
|
|
|
|
RUN useradd -ms /bin/bash myuser |
|
|
|
|
|
RUN mkdir -p /home/myuser/.cache/huggingface/hub && \ |
|
chown -R myuser /home/myuser/.cache |
|
|
|
|
|
USER myuser |
|
|
|
|
|
EXPOSE 80 |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] |
|
|