feat: add frps/frpc/mineru-sgalng
This commit is contained in:
10
README.md
10
README.md
@@ -4,10 +4,12 @@ Compose Anything helps users quickly deploy various services by providing a set
|
||||
|
||||
## Supported Services
|
||||
|
||||
| Service | Version |
|
||||
| ---------------------------- | ------- |
|
||||
| [Redis](./src/redis) | 8.2.1 |
|
||||
| [MinerU v2](./src/mineru-v2) | 2.5.3 |
|
||||
| Service | Version |
|
||||
| ---------------------------------------- | ------- |
|
||||
| [Redis](./src/redis) | 8.2.1 |
|
||||
| [MinerU v2](./src/mineru-v2) | 2.5.3 |
|
||||
| [Bifrost Gateway](./src/bifrost-gateway) | 1.2.15 |
|
||||
| [Docker Registry](./src/docker-registry) | 3.0.0 |
|
||||
|
||||
## Guidelines
|
||||
|
||||
|
||||
10
README.zh.md
10
README.zh.md
@@ -4,10 +4,12 @@ Compose Anything 通过提供一组高质量的 Docker Compose 配置文件,
|
||||
|
||||
## 已经支持的服务
|
||||
|
||||
| 服务 | 版本 |
|
||||
| ---------------------------- | ----- |
|
||||
| [Redis](./src/redis) | 8.2.1 |
|
||||
| [MinerU v2](./src/mineru-v2) | 2.5.3 |
|
||||
| 服务 | 版本 |
|
||||
| ---------------------------------------- | ------ |
|
||||
| [Redis](./src/redis) | 8.2.1 |
|
||||
| [MinerU v2](./src/mineru-v2) | 2.5.3 |
|
||||
| [Bifrost Gateway](./src/bifrost-gateway) | 1.2.15 |
|
||||
| [Docker Registry](./src/docker-registry) | 3.0.0 |
|
||||
|
||||
## 规范
|
||||
|
||||
|
||||
32
src/frpc/README.md
Normal file
32
src/frpc/README.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# FRPC
|
||||
|
||||
内网穿透客户端。
|
||||
|
||||
以 SSH 服务穿透为例,新建 `frpc.toml` 配置文件,内容如下:
|
||||
|
||||
```toml
|
||||
[common]
|
||||
server_addr = {{ .Envs.FRP_SERVER_ADDR }}
|
||||
server_port = {{ .Envs.FRP_SERVER_PORT }}
|
||||
token = {{ .Envs.FRP_SERVER_TOKEN }}
|
||||
|
||||
[app_22]
|
||||
type = "tcp"
|
||||
remote_port = 23922
|
||||
local_ip = 192.168.10.100
|
||||
local_port = 22
|
||||
```
|
||||
|
||||
配置远程 FRPS 服务地址到 `.env` 文件中:
|
||||
|
||||
```properties
|
||||
FRP_SERVER_ADDR=frps.example.com
|
||||
FRP_SERVER_PORT=9870
|
||||
FRP_SERVER_TOKEN=password
|
||||
```
|
||||
|
||||
启动服务,即可代理 `192.168.10.100:22` 到 `FRP_SERVER_ADDR:23922`。
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
30
src/frpc/docker-compose.yaml
Normal file
30
src/frpc/docker-compose.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
x-default: &default
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- &localtime /etc/localtime:/etc/localtime:ro
|
||||
- &timezone /etc/timezone:/etc/timezone:ro
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 100m
|
||||
|
||||
services:
|
||||
frpc:
|
||||
<<: *default
|
||||
image: snowdreamtech/frpc:${FRPC_VERSION:-0.64.0}
|
||||
volumes:
|
||||
- *localtime
|
||||
- *timezone
|
||||
- ./frpc.toml:/etc/frp/frpc.toml:ro
|
||||
environment:
|
||||
FRP_SERVER_ADDR: ${FRP_SERVER_ADDR}
|
||||
FRP_SERVER_PORT: ${FRP_SERVER_PORT}
|
||||
FRP_SERVER_TOKEN: ${FRP_SERVER_TOKEN}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 128M
|
||||
reservations:
|
||||
cpus: '0.1'
|
||||
memory: 64M
|
||||
10
src/frpc/frpc.toml
Normal file
10
src/frpc/frpc.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[common]
|
||||
server_addr = {{ .Envs.FRP_SERVER_ADDR }}
|
||||
server_port = {{ .Envs.FRP_SERVER_PORT }}
|
||||
token = {{ .Envs.FRP_SERVER_TOKEN }}
|
||||
|
||||
[app]
|
||||
type = "tcp"
|
||||
remote_port = 22
|
||||
local_ip = {{ .Envs.APP_HOST }}
|
||||
local_port = 22
|
||||
35
src/frps/README.zh.md
Normal file
35
src/frps/README.zh.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# FRPS
|
||||
|
||||
内网穿透服务端。
|
||||
|
||||
新建 `frps.toml` 配置文件,内容如下:
|
||||
|
||||
```toml
|
||||
[common]
|
||||
bind_port = {{ .Envs.FRP_SERVER_PORT }}
|
||||
token = {{ .Envs.FRP_SERVER_TOKEN }}
|
||||
|
||||
dashboard_addr = 0.0.0.0
|
||||
dashboard_port = {{ .Envs.FRP_ADMIN_PORT }}
|
||||
dashboard_user = {{ .Envs.FRP_ADMIN_USER }}
|
||||
dashboard_pwd = {{ .Envs.FRP_ADMIN_PASS }}
|
||||
```
|
||||
|
||||
配置密钥等信息到 `.env` 文件中:
|
||||
|
||||
```properties
|
||||
FRP_SERVER_TOKEN=token
|
||||
FRP_ADMIN_USER=admin
|
||||
FRP_ADMIN_PASS=password
|
||||
```
|
||||
|
||||
启动服务,即可代理客户端请求,注意需要将客户端的端口映射出来。可以通过 HOST 网络或共享网络的方式共享服务。
|
||||
|
||||
使用如下方法启用 HOST 模式:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
frps:
|
||||
# ...
|
||||
network_mode: host
|
||||
```
|
||||
35
src/frps/docker-compose.yaml
Normal file
35
src/frps/docker-compose.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
x-default: &default
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- &localtime /etc/localtime:/etc/localtime:ro
|
||||
- &timezone /etc/timezone:/etc/timezone:ro
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 100m
|
||||
|
||||
services:
|
||||
frps:
|
||||
<<: *default
|
||||
image: snowdreamtech/frps:${FRPS_VERSION:-0.64.0}
|
||||
volumes:
|
||||
- *localtime
|
||||
- *timezone
|
||||
- ./frps.toml:/etc/frp/frps.toml:ro
|
||||
ports:
|
||||
- ${FRP_PORT_OVERRIDE_SERVER:-9870}:${FRP_SERVER_PORT:-9870}
|
||||
- ${FRP_PORT_OVERRIDE_ADMIN:-7890}:${FRP_ADMIN_PORT:-7890}
|
||||
environment:
|
||||
FRP_SERVER_TOKEN: ${FRP_SERVER_TOKEN}
|
||||
FRP_SERVER_PORT: ${FRP_SERVER_PORT:-9870}
|
||||
FRP_ADMIN_PORT: ${FRP_ADMIN_PORT:-7890}
|
||||
FRP_ADMIN_USER: ${FRP_ADMIN_USER:-admin}
|
||||
FRP_ADMIN_PASS: ${FRP_ADMIN_PASS:-password}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 128M
|
||||
reservations:
|
||||
cpus: '0.1'
|
||||
memory: 64M
|
||||
8
src/frps/frps.toml
Normal file
8
src/frps/frps.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[common]
|
||||
bind_port = {{ .Envs.FRP_SERVER_PORT }}
|
||||
token = {{ .Envs.FRP_SERVER_TOKEN }}
|
||||
|
||||
dashboard_addr = 0.0.0.0
|
||||
dashboard_port = {{ .Envs.FRP_ADMIN_PORT }}
|
||||
dashboard_user = {{ .Envs.FRP_ADMIN_USER }}
|
||||
dashboard_pwd = {{ .Envs.FRP_ADMIN_PASS }}
|
||||
26
src/mineru-sgalng/README.md
Normal file
26
src/mineru-sgalng/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# MinerU SGLang
|
||||
|
||||
SGLang backend server:
|
||||
|
||||
```bash
|
||||
docker compose --profile sglang-server up -d
|
||||
```
|
||||
|
||||
Document parse API:
|
||||
|
||||
```bash
|
||||
docker compose --profile api up -d
|
||||
```
|
||||
|
||||
Gradio WebUI:
|
||||
|
||||
```bash
|
||||
docker compose --profile gradio up -d
|
||||
```
|
||||
|
||||
Test SGLang backend:
|
||||
|
||||
```bash
|
||||
pip install mineru
|
||||
mineru -p demo.pdf -o ./output -b vlm-sglang-client -u http://localhost:30000
|
||||
```
|
||||
90
src/mineru-sgalng/docker-compose.yaml
Normal file
90
src/mineru-sgalng/docker-compose.yaml
Normal file
@@ -0,0 +1,90 @@
|
||||
x-default: &default
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- &localtime /etc/localtime:/etc/localtime:ro
|
||||
- &timezone /etc/timezone:/etc/timezone:ro
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 100m
|
||||
|
||||
x-mineru-sglang: &mineru-sglang
|
||||
<<: *default
|
||||
image: ${MINERU_DOCKER_IMAGE:-alexsuntop/mineru-sglang:2.2.2}
|
||||
environment:
|
||||
MINERU_MODEL_SOURCE: local
|
||||
ulimits:
|
||||
memlock: -1
|
||||
stack: 67108864
|
||||
ipc: host
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '8.0'
|
||||
memory: 4G
|
||||
reservations:
|
||||
cpus: '1.0'
|
||||
memory: 2G
|
||||
devices:
|
||||
- driver: nvidia
|
||||
device_ids: [ '0' ]
|
||||
capabilities: [ gpu ]
|
||||
|
||||
services:
|
||||
mineru-sglang-server:
|
||||
<<: *mineru-sglang
|
||||
profiles: ["sglang-server"]
|
||||
ports:
|
||||
- ${MINERU_PORT_OVERRIDE_SGLANG:-30000}:30000
|
||||
entrypoint: mineru-sglang-server
|
||||
command:
|
||||
- --host 0.0.0.0
|
||||
- --port 30000
|
||||
|
||||
# If using multiple GPUs, increase throughput using vllm's multi-GPU parallel mode.
|
||||
# - --data-parallel-size 2
|
||||
# If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter,
|
||||
# if VRAM issues persist, try lowering it further to `0.4` or below.
|
||||
# - --gpu-memory-utilization 0.5
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:30000/health || exit 1"]
|
||||
|
||||
mineru-api:
|
||||
<<: *mineru-sglang
|
||||
profiles: ["api"]
|
||||
ports:
|
||||
- ${MINERU_PORT_OVERRIDE_API:-8000}:8000
|
||||
entrypoint: mineru-api
|
||||
command:
|
||||
- --host 0.0.0.0
|
||||
- --port 8000
|
||||
|
||||
# If using multiple GPUs, increase throughput using vllm's multi-GPU parallel mode.
|
||||
# - --data-parallel-size 2
|
||||
# If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter,
|
||||
# if VRAM issues persist, try lowering it further to `0.4` or below.
|
||||
# - --gpu-memory-utilization 0.5
|
||||
|
||||
mineru-gradio:
|
||||
<<: *mineru-sglang
|
||||
profiles: ["gradio"]
|
||||
ports:
|
||||
- ${MINERU_PORT_OVERRIDE_GRADIO:-7860}:7860
|
||||
entrypoint: mineru-gradio
|
||||
command:
|
||||
- --server-name 0.0.0.0
|
||||
- --server-port 7860
|
||||
|
||||
# Enable the vllm engine for Gradio
|
||||
- --enable-vllm-engine true
|
||||
# If you want to disable the API, set this to false
|
||||
# - --enable-api false
|
||||
# If you want to limit the number of pages for conversion, set this to a specific number
|
||||
# - --max-convert-pages 20
|
||||
|
||||
# If using multiple GPUs, increase throughput using vllm's multi-GPU parallel mode.
|
||||
# - --data-parallel-size 2
|
||||
# If running on a single GPU and encountering VRAM shortage, reduce the KV cache size by this parameter,
|
||||
# if VRAM issues persist, try lowering it further to `0.4` or below.
|
||||
# - --gpu-memory-utilization 0.5
|
||||
@@ -23,7 +23,7 @@ x-mineru-vllm: &mineru-vllm
|
||||
cpus: '8.0'
|
||||
memory: 4G
|
||||
reservations:
|
||||
cpus: '2.0'
|
||||
cpus: '1.0'
|
||||
memory: 2G
|
||||
devices:
|
||||
- driver: nvidia
|
||||
|
||||
Reference in New Issue
Block a user