feat: add Doris and Overleaf services with configuration files

This commit is contained in:
Sun-ZhenXing
2026-01-15 15:13:05 +08:00
parent 3efc2150fe
commit 10313b35e9
11 changed files with 531 additions and 1 deletions

72
src/overleaf/.env.example Normal file
View File

@@ -0,0 +1,72 @@
# Overleaf version (ShareLaTeX image)
OVERLEAF_VERSION=5.2.1
# MongoDB version
MONGO_VERSION=6.0
# Redis version
REDIS_VERSION=7-alpine
# Timezone
TZ=UTC
# Global registry prefix (optional)
# GLOBAL_REGISTRY=your-registry.example.com/
# ==================== Port Overrides ====================
# Overleaf HTTP port (default: 8080)
# OVERLEAF_PORT_OVERRIDE=8080
# ==================== Overleaf Configuration ====================
# Enable subscriptions (true/false)
# ENABLE_SUBSCRIPTIONS=false
# Application name displayed in web UI
# SHARELATEX_APP_NAME=Overleaf
# Use secure cookies (set to true if using HTTPS)
# SHARELATEX_SECURE_COOKIE=false
# Administrator email addresses (comma-separated)
# SHARELATEX_ADMIN_EMAILS=admin@example.com
# Run behind proxy (set to true if using reverse proxy)
# SHARELATEX_BEHIND_PROXY=true
# Navigation bar title
# SHARELATEX_NAV_TITLE=Community Edition
# Enable LaTeX typesetting with latexmk
# LATEX_AVAILABLE_LATEXMK=true
# ==================== Resource Limits (Overleaf) ====================
# Overleaf CPU limits
# OVERLEAF_CPU_LIMIT=2.00
# OVERLEAF_CPU_RESERVATION=0.50
# Overleaf Memory limits
# OVERLEAF_MEMORY_LIMIT=2G
# OVERLEAF_MEMORY_RESERVATION=1G
# ==================== Resource Limits (MongoDB) ====================
# MongoDB CPU limits
# MONGO_CPU_LIMIT=1.00
# MONGO_CPU_RESERVATION=0.25
# MongoDB Memory limits
# MONGO_MEMORY_LIMIT=1G
# MONGO_MEMORY_RESERVATION=512M
# ==================== Resource Limits (Redis) ====================
# Redis CPU limits
# REDIS_CPU_LIMIT=0.50
# REDIS_CPU_RESERVATION=0.25
# Redis Memory limits
# REDIS_MEMORY_LIMIT=512M
# REDIS_MEMORY_RESERVATION=256M

56
src/overleaf/README.md Normal file
View File

@@ -0,0 +1,56 @@
# Overleaf
Overleaf is a web-based collaborative LaTeX editor that makes the writing of technical documents as easy as pie. Write, compile, and download LaTeX documents online with automatic cloud backup.
## Quick Start
```bash
docker compose up -d
```
## Ports
| Service | Port | Purpose |
| -------- | ---- | ------------- |
| Overleaf | 8080 | Web Interface |
## Default Access
- Web UI: <http://localhost:8080>
- Create a new account or log in
## Environment Variables
Key environment variables:
- `OVERLEAF_VERSION`: Docker image version (default: 5.2.1)
- `OVERLEAF_PORT_OVERRIDE`: Override default HTTP port (default: 8080)
- `SHARELATEX_APP_NAME`: Application name (default: Overleaf)
- `SHARELATEX_ADMIN_EMAILS`: Admin email addresses
- `ENABLE_SUBSCRIPTIONS`: Enable subscription features (default: false)
See `.env.example` for all available options.
## Services Included
- **Overleaf**: Main application
- **MongoDB**: Project and user data storage
- **Redis**: Session and cache management
## Features
- Real-time collaborative editing
- Rich text and code editors
- Instant preview of compiled documents
- Version control and history
- Templates library
- Git integration (Pro)
## Documentation
- [Overleaf Official Docs](https://www.overleaf.com/learn)
- [Community Server Setup](https://www.overleaf.com/help/207-how-does-overleaf-help-with-group-collaboration)
## License
AGPL License (Community Edition)

56
src/overleaf/README.zh.md Normal file
View File

@@ -0,0 +1,56 @@
# Overleaf
Overleaf 是一个基于网络的协作式 LaTeX 编辑器,使技术文档的编写如同小菜一碟。在线编写、编译和下载 LaTeX 文档,具有自动云备份功能。
## 快速开始
```bash
docker compose up -d
```
## 端口
| 服务 | 端口 | 用途 |
| -------- | ---- | -------- |
| Overleaf | 8080 | Web 界面 |
## 默认访问
- Web UI<http://localhost:8080>
- 创建新账户或登录
## 环境变量
关键环境变量:
- `OVERLEAF_VERSION`Docker 镜像版本默认值5.2.1
- `OVERLEAF_PORT_OVERRIDE`:覆盖默认 HTTP 端口默认值8080
- `SHARELATEX_APP_NAME`应用程序名称默认值Overleaf
- `SHARELATEX_ADMIN_EMAILS`:管理员电子邮件地址
- `ENABLE_SUBSCRIPTIONS`启用订阅功能默认值false
请查看 `.env.example` 获取所有可用选项。
## 包含的服务
- **Overleaf**:主应用程序
- **MongoDB**:项目和用户数据存储
- **Redis**:会话和缓存管理
## 功能特性
- 实时协作编辑
- 富文本和代码编辑器
- 编译文档的即时预览
- 版本控制和历史记录
- 模板库
- Git 集成Pro 版)
## 文档
- [Overleaf 官方文档](https://www.overleaf.com/learn)
- [社区服务器设置](https://www.overleaf.com/help/207-how-does-overleaf-help-with-group-collaboration)
## 许可证
AGPL 许可证(社区版)

View File

@@ -0,0 +1,106 @@
# Overleaf Docker Compose
# Overleaf is a web-based collaborative LaTeX editor
# Provides standalone deployment with MongoDB for development/testing
x-defaults: &defaults
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
services:
# MongoDB for Overleaf data storage
mongo:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}mongo:${MONGO_VERSION:-6.0}
hostname: overleaf-mongo
volumes:
- mongo_data:/data/db
environment:
- TZ=${TZ:-UTC}
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: ${MONGO_CPU_LIMIT:-1.00}
memory: ${MONGO_MEMORY_LIMIT:-1G}
reservations:
cpus: ${MONGO_CPU_RESERVATION:-0.25}
memory: ${MONGO_MEMORY_RESERVATION:-512M}
# Redis for session and cache storage
redis:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}redis:${REDIS_VERSION:-7-alpine}
hostname: overleaf-redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
environment:
- TZ=${TZ:-UTC}
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: ${REDIS_CPU_LIMIT:-0.50}
memory: ${REDIS_MEMORY_LIMIT:-512M}
reservations:
cpus: ${REDIS_CPU_RESERVATION:-0.25}
memory: ${REDIS_MEMORY_RESERVATION:-256M}
# Overleaf main application
overleaf:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}sharelatex/sharelatex:${OVERLEAF_VERSION:-5.2.1}
hostname: overleaf
ports:
- "${OVERLEAF_PORT_OVERRIDE:-8080}:80"
volumes:
- overleaf_data:/var/lib/overleaf
environment:
- TZ=${TZ:-UTC}
- MONGO_URL=mongodb://mongo:27017/overleaf
- REDIS_URL=redis://redis:6379
- ENABLE_SUBSCRIPTIONS=${ENABLE_SUBSCRIPTIONS:-false}
- SHARELATEX_APP_NAME=${SHARELATEX_APP_NAME:-Overleaf}
- SHARELATEX_SECURE_COOKIE=${SHARELATEX_SECURE_COOKIE:-false}
- SHARELATEX_ADMIN_EMAILS=${SHARELATEX_ADMIN_EMAILS:-admin@example.com}
- SHARELATEX_BEHIND_PROXY=${SHARELATEX_BEHIND_PROXY:-true}
- SHARELATEX_NAV_TITLE=${SHARELATEX_NAV_TITLE:-Community Edition}
- LATEX_AVAILABLE_LATEXMK=${LATEX_AVAILABLE_LATEXMK:-true}
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
deploy:
resources:
limits:
cpus: ${OVERLEAF_CPU_LIMIT:-2.00}
memory: ${OVERLEAF_MEMORY_LIMIT:-2G}
reservations:
cpus: ${OVERLEAF_CPU_RESERVATION:-0.50}
memory: ${OVERLEAF_MEMORY_RESERVATION:-1G}
volumes:
mongo_data:
redis_data:
overleaf_data: