-
-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·57 lines (45 loc) · 1.81 KB
/
Dockerfile
File metadata and controls
executable file
·57 lines (45 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM pytorch/pytorch:2.4.0-cuda11.8-cudnn9-runtime
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN apt-get update
RUN apt-get install --fix-missing -y -q --no-install-recommends libgomp1 ffmpeg libsm6 pdftohtml libxext6 git ninja-build g++ qpdf pandoc curl
RUN apt-get install -y ocrmypdf
RUN apt-get install -y tesseract-ocr-fra
RUN apt-get install -y tesseract-ocr-spa
RUN apt-get install -y tesseract-ocr-deu
RUN apt-get install -y tesseract-ocr-ara
RUN apt-get install -y tesseract-ocr-mya
RUN apt-get install -y tesseract-ocr-hin
RUN apt-get install -y tesseract-ocr-tam
RUN apt-get install -y tesseract-ocr-tha
RUN apt-get install -y tesseract-ocr-chi-sim
RUN apt-get install -y tesseract-ocr-tur
RUN apt-get install -y tesseract-ocr-ukr
RUN apt-get install -y tesseract-ocr-ell
RUN apt-get install -y tesseract-ocr-rus
RUN apt-get install -y tesseract-ocr-kor
RUN apt-get install -y tesseract-ocr-kor-vert
RUN mkdir -p /app/src
RUN mkdir -p /app/models
RUN addgroup --system python && adduser --system --group python
RUN chown -R python:python /app
USER python
ENV VIRTUAL_ENV=/app/.venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY requirements.txt requirements.txt
RUN uv pip install --upgrade pip
RUN uv pip install \
-r requirements.txt \
--extra-index-url https://download.pytorch.org/whl/cu128 \
--index-strategy unsafe-best-match
WORKDIR /app
RUN cd src; git clone https://github.com/facebookresearch/detectron2;
RUN cd src/detectron2; git checkout b599f139756bd3646a26a909caf86a1a159e53a7; python setup.py build develop
RUN uv pip install pycocotools==2.0.11
COPY ./start.sh ./start.sh
COPY ./src/. ./src
COPY ./models/. ./models/
RUN python src/download_models.py
ENV PYTHONPATH "${PYTHONPATH}:/app/src"
ENV TRANSFORMERS_VERBOSITY=error
ENV TRANSFORMERS_NO_ADVISORY_WARNINGS=1