-
Notifications
You must be signed in to change notification settings - Fork 11
Deployment
Anson edited this page Jun 14, 2026
·
2 revisions
MBEditor 用 Docker Compose 一键部署,前后端各一个容器 + Nginx 反代。
git clone https://github.com/AAAAAnson/mbeditor.git
cd mbeditor
docker compose up -d| 服务 | 地址 | 说明 |
|---|---|---|
| 编辑器 | http://localhost:7073 |
前端(Nginx 静态 + 反代 /api) |
| API | http://localhost:7072/api/v1 |
后端 FastAPI |
默认端口绑定
127.0.0.1(只本机可访问)。要在局域网/公网访问,在前面加一层带 TLS 的反向代理,不要把后端端口直接裸暴露到公网。
cd mbeditor
git pull
docker compose up -d --build前端是 Vite 打包进镜像的,改了前端代码或模板必须 --build 重新构建才生效(光 git pull 不够)。
| 数据 | 存在哪 | 是否进 git |
|---|---|---|
| 文章 / 图片 | 浏览器 localStorage 或外部图床 | 否 |
| 公众号 AppID | 浏览器 localStorage | 否 |
| 公众号 AppSecret | 后端具名卷 mbeditor-data(credentials.json,按 AppID、写后不回显);浏览器端不落 localStorage |
否(卷在仓库目录树外) |
| 网关配置(地址/令牌/证书) | 后端 Docker 具名卷 mbeditor-data
|
否(卷在仓库目录树外) |
具名卷扛得住 docker compose up -d --build(重建容器不丢配置)。只有 docker compose down -v 会清空具名卷。
复制 .env.example 为 .env 按需填写。常用项:
| 变量 | 用途 |
|---|---|
MBEDITOR_BIND_HOST |
端口绑定地址(默认 127.0.0.1) |
CORS_ALLOWED_ORIGINS |
允许的前端来源 |
WECHAT_API_BASE / WECHAT_PROXY_TOKEN / WECHAT_PROXY_CA
|
微信网关中转(见 微信网关配置) |
.env已被.gitignore覆盖,真实值永远不进 git。