forked from PDFMathTranslate/PDFMathTranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.Demo
More file actions
31 lines (25 loc) · 972 Bytes
/
Dockerfile.Demo
File metadata and controls
31 lines (25 loc) · 972 Bytes
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
FROM python:3.12
############################
## Hugging Face Optimized ##
############################
WORKDIR /app
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y libgl1 \
&& rm -rf /var/lib/apt/lists/*
RUN pip install pdf2zh
RUN mkdir -p /data
RUN chmod 777 /data
RUN mkdir -p /app
RUN chmod 777 /app
RUN mkdir -p /.cache
RUN chmod 777 /.cache
RUN mkdir -p ./gradio_files
RUN chmod 777 ./gradio_files
RUN mkdir -p /.config
RUN chmod 777 /.config
RUN mkdir -p /.config/PDFMathTranslate
RUN chmod 777 /.config/PDFMathTranslate
# write several lines to the file /.config/PDFMathTranslate/config.json
RUN echo '{ "USE_MODELSCOPE": "0", "PDF2ZH_LANG_FROM": "English", "PDF2ZH_LANG_TO": "Simplified Chinese", "NOTO_FONT_PATH": "/app/SourceHanSerifCN-Regular.ttf", "translators":[]}' > /.config/PDFMathTranslate/config.json
RUN chmod 777 /.config/PDFMathTranslate/config.json
CMD ["pdf2zh", "-i", "--config", "/.config/PDFMathTranslate/config.json"]