refactor: ./apps/*

This commit is contained in:
Sun-ZhenXing
2026-01-01 18:32:10 +08:00
parent 9c25970445
commit 922068b8af
37 changed files with 274 additions and 241 deletions

View File

@@ -0,0 +1,37 @@
# Stirling-PDF version
STIRLING_VERSION="latest"
# Port override
PORT_OVERRIDE=8080
# Security settings
ENABLE_SECURITY="false"
ENABLE_LOGIN="false"
INITIAL_USERNAME="admin"
INITIAL_PASSWORD="admin"
# Advanced operations (requires more dependencies)
INSTALL_ADVANCED_OPS="false"
# Languages (comma-separated, e.g., en_GB,ar_AR,de_DE,fr_FR,es_ES)
LANGUAGES="en_GB"
# User and group IDs
PUID=1000
PGID=1000
UMASK="022"
# System settings
DEFAULT_LOCALE="en-US"
APP_NAME="Stirling-PDF"
HOME_DESCRIPTION=""
NAVBAR_NAME=""
# Maximum file size in MB
MAX_FILE_SIZE="2000"
# Metrics
METRICS_ENABLED="false"
# Google visibility
GOOGLE_VISIBILITY="false"

View File

@@ -0,0 +1,67 @@
# Stirling-PDF
[English](./README.md) | [中文](./README.zh.md)
This service deploys Stirling-PDF, a locally hosted web-based PDF manipulation tool.
## Services
- `stirling-pdf`: The Stirling-PDF service.
## Environment Variables
| Variable Name | Description | Default Value |
| -------------------- | ------------------------------------- | -------------- |
| STIRLING_VERSION | Stirling-PDF image version | `latest` |
| PORT_OVERRIDE | Host port mapping | `8080` |
| ENABLE_SECURITY | Enable security features | `false` |
| ENABLE_LOGIN | Enable login functionality | `false` |
| INITIAL_USERNAME | Initial admin username | `admin` |
| INITIAL_PASSWORD | Initial admin password | `admin` |
| INSTALL_ADVANCED_OPS | Install advanced operations | `false` |
| LANGUAGES | Supported languages (comma-separated) | `en_GB` |
| PUID | User ID to run the service | `1000` |
| PGID | Group ID to run the service | `1000` |
| UMASK | File creation mask | `022` |
| DEFAULT_LOCALE | Default system locale | `en-US` |
| APP_NAME | Application name | `Stirling-PDF` |
| HOME_DESCRIPTION | Home page description | `""` |
| NAVBAR_NAME | Navigation bar name | `""` |
| MAX_FILE_SIZE | Maximum file size in MB | `2000` |
| METRICS_ENABLED | Enable metrics collection | `false` |
| GOOGLE_VISIBILITY | Allow Google indexing | `false` |
Please modify the `.env` file as needed for your use case.
## Volumes
- `stirling_trainingData`: OCR training data for Tesseract.
- `stirling_configs`: Configuration files.
- `stirling_logs`: Application logs.
- `stirling_customFiles`: Custom files and templates.
## Features
Stirling-PDF supports 50+ PDF operations including:
- Merge, split, rotate PDFs
- Convert to/from PDF
- OCR (Optical Character Recognition)
- Add/remove watermarks
- Compress PDFs
- Encrypt/decrypt PDFs
- Sign PDFs
- Fill forms
- Extract images and text
- And much more!
## Security Notes
- By default, security is disabled for easy setup.
- For production use, set `ENABLE_SECURITY=true` and `ENABLE_LOGIN=true`.
- Change the default admin credentials before deployment.
- Consider using a reverse proxy with HTTPS for secure access.
## License
Stirling-PDF is licensed under the MIT License.

View File

@@ -0,0 +1,67 @@
# Stirling-PDF
[English](./README.md) | [中文](./README.zh.md)
此服务用于部署 Stirling-PDF一个本地托管的基于 Web 的 PDF 操作工具。
## 服务
- `stirling-pdf`: Stirling-PDF 服务。
## 环境变量
| 变量名 | 说明 | 默认值 |
| -------------------- | ---------------------- | -------------- |
| STIRLING_VERSION | Stirling-PDF 镜像版本 | `latest` |
| PORT_OVERRIDE | 主机端口映射 | `8080` |
| ENABLE_SECURITY | 启用安全功能 | `false` |
| ENABLE_LOGIN | 启用登录功能 | `false` |
| INITIAL_USERNAME | 初始管理员用户名 | `admin` |
| INITIAL_PASSWORD | 初始管理员密码 | `admin` |
| INSTALL_ADVANCED_OPS | 安装高级操作 | `false` |
| LANGUAGES | 支持的语言(逗号分隔) | `en_GB` |
| PUID | 运行服务的用户 ID | `1000` |
| PGID | 运行服务的组 ID | `1000` |
| UMASK | 文件创建掩码 | `022` |
| DEFAULT_LOCALE | 默认系统区域设置 | `en-US` |
| APP_NAME | 应用程序名称 | `Stirling-PDF` |
| HOME_DESCRIPTION | 主页描述 | `""` |
| NAVBAR_NAME | 导航栏名称 | `""` |
| MAX_FILE_SIZE | 最大文件大小MB | `2000` |
| METRICS_ENABLED | 启用指标收集 | `false` |
| GOOGLE_VISIBILITY | 允许 Google 索引 | `false` |
请根据实际需求修改 `.env` 文件。
## 卷
- `stirling_trainingData`: Tesseract 的 OCR 训练数据。
- `stirling_configs`: 配置文件。
- `stirling_logs`: 应用程序日志。
- `stirling_customFiles`: 自定义文件和模板。
## 功能
Stirling-PDF 支持 50 多种 PDF 操作,包括:
- 合并、拆分、旋转 PDF
- PDF 转换
- OCR光学字符识别
- 添加/删除水印
- 压缩 PDF
- 加密/解密 PDF
- 签名 PDF
- 填写表单
- 提取图像和文本
- 以及更多功能!
## 安全说明
- 默认情况下,安全功能被禁用以便于设置。
- 对于生产环境,请设置 `ENABLE_SECURITY=true``ENABLE_LOGIN=true`
- 在部署前更改默认管理员凭据。
- 考虑使用反向代理和 HTTPS 以实现安全访问。
## 许可证
Stirling-PDF 使用 MIT 许可证授权。

View File

@@ -0,0 +1,57 @@
x-defaults: &defaults
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
services:
stirling-pdf:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}stirlingtools/stirling-pdf:${STIRLING_VERSION:-latest}
ports:
- "${PORT_OVERRIDE:-8080}:8080"
volumes:
- stirling_trainingData:/usr/share/tessdata
- stirling_configs:/configs
- stirling_logs:/logs
- stirling_customFiles:/customFiles
environment:
- TZ=${TZ:-UTC}
- DOCKER_ENABLE_SECURITY=${ENABLE_SECURITY:-false}
- SECURITY_ENABLELOGIN=${ENABLE_LOGIN:-false}
- SECURITY_INITIALLOGIN_USERNAME=${INITIAL_USERNAME:-admin}
- SECURITY_INITIALLOGIN_PASSWORD=${INITIAL_PASSWORD:-admin}
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=${INSTALL_ADVANCED_OPS:-false}
- LANGS=${LANGUAGES:-en_GB}
- PUID=${PUID:-1000}
- PGID=${PGID:-1000}
- UMASK=${UMASK:-022}
- SYSTEM_DEFAULTLOCALE=${DEFAULT_LOCALE:-en-US}
- UI_APPNAME=${APP_NAME:-Stirling-PDF}
- UI_HOMEDESCRIPTION=${HOME_DESCRIPTION:-}
- UI_APPNAMENAVBAR=${NAVBAR_NAME:-}
- SYSTEM_MAXFILESIZE=${MAX_FILE_SIZE:-2000}
- METRICS_ENABLED=${METRICS_ENABLED:-false}
- SYSTEM_GOOGLEVISIBILITY=${GOOGLE_VISIBILITY:-false}
deploy:
resources:
limits:
cpus: ${STIRLING_CPU_LIMIT:-2.0}
memory: ${STIRLING_MEMORY_LIMIT:-4G}
reservations:
cpus: ${STIRLING_CPU_RESERVATION:-1.0}
memory: ${STIRLING_MEMORY_RESERVATION:-2G}
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
stirling_trainingData:
stirling_configs:
stirling_logs:
stirling_customFiles: