Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
|
@@ -18,12 +18,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 18 |
pip3 install --no-cache-dir unoconv WeasyPrint pdf2image pillow && \
|
| 19 |
rm -rf /var/lib/apt/lists/*
|
| 20 |
|
| 21 |
-
# 创建必要的目录
|
| 22 |
-
RUN mkdir -p /app/logs /app/configs /app/customFiles /usr/share/tessdata && \
|
| 23 |
-
chmod -R 777 /app/logs /app/configs /app/customFiles /usr/share/tessdata
|
| 24 |
-
|
| 25 |
# 下载Tesseract语言包
|
| 26 |
-
RUN
|
|
|
|
| 27 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/chi_sim.traineddata && \
|
| 28 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/chi_tra.traineddata && \
|
| 29 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata && \
|
|
@@ -38,15 +35,22 @@ RUN cd /usr/share/tessdata && \
|
|
| 38 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/vie.traineddata && \
|
| 39 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/tha.traineddata
|
| 40 |
|
| 41 |
-
# 克隆并构建项目
|
| 42 |
-
RUN
|
|
|
|
|
|
|
| 43 |
./gradlew build && \
|
| 44 |
cp stirling-pdf/build/libs/*.jar /app/stirling-pdf.jar && \
|
| 45 |
-
|
|
|
|
| 46 |
apt-get remove -y git gradle maven && \
|
| 47 |
apt-get autoremove -y && \
|
| 48 |
apt-get clean
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
# 设置环境变量
|
| 51 |
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75"
|
| 52 |
ENV TESSDATA_PREFIX="/usr/share/tessdata"
|
|
|
|
| 18 |
pip3 install --no-cache-dir unoconv WeasyPrint pdf2image pillow && \
|
| 19 |
rm -rf /var/lib/apt/lists/*
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# 下载Tesseract语言包
|
| 22 |
+
RUN mkdir -p /usr/share/tessdata && \
|
| 23 |
+
cd /usr/share/tessdata && \
|
| 24 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/chi_sim.traineddata && \
|
| 25 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/chi_tra.traineddata && \
|
| 26 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata && \
|
|
|
|
| 35 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/vie.traineddata && \
|
| 36 |
wget -q https://github.com/tesseract-ocr/tessdata/raw/main/tha.traineddata
|
| 37 |
|
| 38 |
+
# 在临时目录克隆并构建项目
|
| 39 |
+
RUN cd /tmp && \
|
| 40 |
+
git clone https://github.com/Stirling-Tools/Stirling-PDF.git stirling-pdf && \
|
| 41 |
+
cd stirling-pdf && \
|
| 42 |
./gradlew build && \
|
| 43 |
cp stirling-pdf/build/libs/*.jar /app/stirling-pdf.jar && \
|
| 44 |
+
cd / && \
|
| 45 |
+
rm -rf /tmp/stirling-pdf ~/.gradle /tmp/* && \
|
| 46 |
apt-get remove -y git gradle maven && \
|
| 47 |
apt-get autoremove -y && \
|
| 48 |
apt-get clean
|
| 49 |
|
| 50 |
+
# 创建必要的目录
|
| 51 |
+
RUN mkdir -p /app/logs /app/configs /app/customFiles && \
|
| 52 |
+
chmod -R 777 /app/logs /app/configs /app/customFiles /usr/share/tessdata
|
| 53 |
+
|
| 54 |
# 设置环境变量
|
| 55 |
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75"
|
| 56 |
ENV TESSDATA_PREFIX="/usr/share/tessdata"
|