跳转到内容
mofcloud

使用 Docker Compose 部署 MOF

最近更新:

在一台服务器上运行 MOF、Dash 和 MCP。

Linux amd64 · Docker Compose v2.20+ · 2 vCPU / 4 GB · 开放 80 端口

数据库

镜像源

下载 compose.yaml

阿里云 ACR · MOF v2.0.15 · Dash v2.0.17 · MCP v2.0.3

下载 compose.yaml ↓
查看文件和镜像
compose.yaml
# MOF v2.0.15 + Dash v2.0.17 + MCP v2.0.3 — Linux amd64
# Save as compose.yaml. Set x-db-password once before the first start.
# Keep your existing database password and volume names when upgrading.
# Keep the service names mof, mof-mcp and dash: they find each other by them (mof:8080,
# mof-mcp:8001). Renamed services can't connect.
name: mof
x-db-password: &db-password "REPLACE_WITH_A_LONG_RANDOM_PASSWORD"
x-logging: &logging
  driver: json-file
  options:
    max-size: "20m"
    max-file: "5"

services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    logging: *logging
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: *db-password
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
      interval: 5s
      timeout: 5s
      retries: 20

  mof:
    image: registry.cn-hangzhou.aliyuncs.com/mofcloud/mof:v2.0.15
    restart: unless-stopped
    logging: *logging
    depends_on:
      postgres:
        condition: service_healthy
    environment:
      RK_POSTGRES_0_ADDR: postgres:5432
      RK_POSTGRES_0_USER: postgres
      RK_POSTGRES_0_PASS: *db-password
    volumes:
      - offer-cache:/usr/src/mof/offer-cache
    healthcheck:
      test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8080/v1/mof/site-info"]
      start_period: 60s
      interval: 10s
      timeout: 5s
      retries: 30

  mof-mcp:
    image: registry.cn-hangzhou.aliyuncs.com/mofcloud/mof-mcp:v2.0.3
    restart: unless-stopped
    logging: *logging
    # Private: no ports. Found by its service name, so any service can restart alone.
    depends_on:
      mof:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "node", "/app/build/healthcheck.js"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 15s

  dash:
    image: registry.cn-hangzhou.aliyuncs.com/mofcloud/dash:v2.0.17
    restart: unless-stopped
    logging: *logging
    depends_on:
      mof:
        condition: service_healthy
    ports:
      - "80:80"

volumes:
  pgdata:
  offer-cache:
固定正式版本
MOFv2.0.15
registry.cn-hangzhou.aliyuncs.com/mofcloud/mof:v2.0.15
Dashv2.0.17
registry.cn-hangzhou.aliyuncs.com/mofcloud/dash:v2.0.17
MCPv2.0.3
registry.cn-hangzhou.aliyuncs.com/mofcloud/mof-mcp:v2.0.3

不要修改服务名 mof、mof-mcp 和 dash。服务之间按这些名字互相访问(mof:8080、mof-mcp:8001),因此无需其他配置;改了名字就连不上。

数据库密码

首次启动前,只需改 compose.yaml 里的这一行;升级时沿用原密码。

x-db-password: &db-password "REPLACE_WITH_A_LONG_RANDOM_PASSWORD"

启动

Terminal
docker compose config --quiet
docker compose up -d
docker compose ps

服务就绪后,查看 Admin 密码:

Terminal
docker compose logs mof | grep "Admin password"

打开 MOF

Adminhttp://SERVER_IP/admin

配置授权并创建用户。

MOF Webhttp://SERVER_IP

普通用户使用 MOF 账号登录。

通过 MCP 接入 AI 客户端

在 Admin → 设置 → MCP 中启用接入。个人令牌不需要 OAuth;浏览器授权需另行配置公网 HTTPS 和 OAuth。