简介
项目地址:Stirling-Tools/Stirling-PDF: locally hosted web application that allows you to perform various operations on PDF files (github.com)
这是一款功能强大的本地托管的基于 Web 的 PDF 操作工具,使用 docker,允许您对 PDF 文件执行各种操作,例如拆分、合并、转换、重组、添加图像、旋转、压缩等。这个本地托管的 Web 应用程序最初是 100% ChatGPT 制作的应用程序,现已发展到包含广泛的功能来处理您的所有 PDF 需求。
部署
可docker、podman部署
docker
docker run -d
-p 8080:8080
-v /location/of/trainingData:/usr/share/tesseract-ocr/5/tessdata
-v /location/of/extraConfigs:/configs
-v /location/of/logs:/logs
-e DOCKER_ENABLE_SECURITY=false
--name stirling-pdf
frooodle/s-pdf:latest
Can also add these for customisation but are not required
-v /location/of/customFiles:/customFiles
docker compose(建议采用docker-compose方式)
利于后期修改配置
version: '3.3'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- '8080:8080'
volumes:
- /location/of/trainingData:/usr/share/tesseract-ocr/5/tessdata #Required for extra OCR languages
- /location/of/extraConfigs:/configs
# - /location/of/customFiles:/customFiles/
# - /location/of/logs:/logs/
environment:
- DOCKER_ENABLE_SECURITY=false
docker-compose up -d
dockerfile
# Use the base image
FROM frooodle/stirling-pdf-base:version8
ARG VERSION_TAG
# Set Environment Variables
ENV DOCKER_ENABLE_SECURITY=false
HOME=/home/stirlingpdfuser
VERSION_TAG=$VERSION_TAG
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75"
# PUID=1000
# PGID=1000
# UMASK=022
# Create user and group
##RUN groupadd -g $PGID stirlingpdfgroup &&
## useradd -u $PUID -g stirlingpdfgroup -s /bin/sh stirlingpdfuser &&
## mkdir -p $HOME && chown stirlingpdfuser:stirlingpdfgroup $HOME
# Set up necessary directories and permissions
RUN mkdir -p /scripts /usr/share/fonts/opentype/noto /usr/share/tesseract-ocr /configs /logs /customFiles /pipeline /pipeline/defaultWebUIConfigs /pipeline/watchedFolders /pipeline/finishedFolders
##&&
## chown -R stirlingpdfuser:stirlingpdfgroup /scripts /usr/share/fonts/opentype/noto /usr/share/tesseract-ocr /configs /customFiles &&
## chown -R stirlingpdfuser:stirlingpdfgroup /usr/share/tesseract-ocr-original
# Copy necessary files
COPY ./scripts/* /scripts/
COPY ./pipeline/ /pipeline/
COPY src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
COPY src/main/resources/static/fonts/*.otf /usr/share/fonts/opentype/noto/
COPY build/libs/*.jar app.jar
# Set font cache and permissions
RUN fc-cache -f -v && chmod +x /scripts/*
##&&
## chown stirlingpdfuser:stirlingpdfgroup /app.jar &&
## chmod +x /scripts/init.sh
# Expose necessary ports
EXPOSE 8080
# Set user and run command
##USER stirlingpdfuser
ENTRYPOINT ["/scripts/init.sh"]
CMD ["java", "-Dfile.encoding=UTF-8", "-jar", "/app.jar"]
配置
修改语言
修改为中文
原文始发于微信公众号(qingjiegong):docker搭建Stirling-PDF进行pdf操作
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论