Bỏ qua để đến nội dung
mofcloud

Triển khai MOF bằng Docker Compose

Cập nhật lần cuối:

MOF, Dash và MCP trên một máy chủ.

Linux amd64 · Docker Compose v2.20+ · 2 vCPU / 4 GB · cổng vào 80

Cơ sở dữ liệu

Nguồn image

Tải xuống compose.yaml

Docker Hub · MOF v2.0.15 · Dash v2.0.17 · MCP v2.0.3

Tải xuống compose.yaml ↓
Xem tệp và image
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: 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: 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: mofcloud/dash:v2.0.17
    restart: unless-stopped
    logging: *logging
    depends_on:
      mof:
        condition: service_healthy
    ports:
      - "80:80"

volumes:
  pgdata:
  offer-cache:
Bản phát hành ổn định đã ghim
MOFv2.0.15
mofcloud/mof:v2.0.15
Dashv2.0.17
mofcloud/dash:v2.0.17
MCPv2.0.3
mofcloud/mof-mcp:v2.0.3

Giữ nguyên tên service mof, mof-mcp và dash. Các service tìm thấy nhau qua những tên này (mof:8080, mof-mcp:8001), nên không cần cấu hình gì thêm; service bị đổi tên sẽ không kết nối được.

Mật khẩu cơ sở dữ liệu

Trước lần khởi động đầu tiên, hãy sửa dòng này trong compose.yaml. Giữ nguyên mật khẩu đó khi nâng cấp.

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

Khởi động

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

Khi đã healthy, lấy mật khẩu Admin:

Terminal
docker compose logs mof | grep "Admin password"

Mở MOF

Adminhttp://SERVER_IP/admin

Cài giấy phép và tạo người dùng.

MOF Webhttp://SERVER_IP

Người dùng đăng nhập bằng tài khoản MOF của họ.

Kết nối AI client qua MCP

Bật quyền truy cập trong Admin → Cài đặt → MCP. Token cá nhân không cần OAuth. Ủy quyền qua trình duyệt cần HTTPS công khai và cấu hình OAuth.