Docker部署martin 矢量切片服务器

Docker部署martin 矢量切片服务器

 

docker pull maplibre/martin:latest

 

 

docker-compose.yml

  martin:
    image: maplibre/martin:latest
    container_name: martin
    restart: unless-stopped
    ports:
      - "3100:3000"
    command: --config /config.yaml
    volumes:
      - D:\DockerMapping\martin\config.yaml:/config.yaml
    environment:
      - DATABASE_URL=postgres://postgres:1234@169.254.65.227:5432/db

 

 

配置文件

D:\DockerMapping\martin\config.yaml

 

# martin.yml
postgres:
  # 数据库连接
  connection_string: "postgresql://admin:123456@192.168.247.130:5432/db"
  # 或使用环境变量
  # connection_string: "${DATABASE_URL}"
  
  # 连接池设置
  pool_size: 20
  
  # 是否监听数据库变化(用于实时更新)
  auto_reconnect: true

server:
  # 服务器监听地址
  listen_addresses: "0.0.0.0:3000"
  
  # CORS 设置
  cors: 
    allowed_origins: ["*"]
  
  # 压缩
  compress: true

cache:
  # 缓存设置
  enabled: true
  size: 128
  
tiles:
  # 切片设置
  format: "pbf"  # 或 "png", "jpg"
  buffer_size: 0
  max_feature_count: 10000

# 数据源配置
sources:
  # 自动发现所有表
  auto_publish: true
  
  # 或手动配置表
  # tables:
  #   - schema: "public"
  #     table: "roads"
  #     id_column: "gid"
  #     geometry_column: "geom"
  #     srid: 3857
  #     bounds: [-180, -85, 180, 85]
  
  # 函数源
  # functions:
  #   - schema: "public"
  #     function: "get_tiles"

 

 

启动

docker-compose up -d martin

 

 

测试:

http://localhost:3100/catalog

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

end.

 

posted @ 2026-01-21 09:59  无心々菜  阅读(1)  评论(0)    收藏  举报