52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
services:
|
|
mars-titiler:
|
|
image: ghcr.io/developmentseed/titiler:latest
|
|
container_name: mars-titiler
|
|
|
|
ports:
|
|
- "8002:8000"
|
|
|
|
# 启动自定义的 Mars Titiler 应用
|
|
command: [
|
|
"uvicorn",
|
|
"app:app",
|
|
"--host", "0.0.0.0",
|
|
"--port", "8000",
|
|
"--reload"
|
|
]
|
|
|
|
working_dir: /mars-titiler
|
|
|
|
environment:
|
|
# Python 模块路径
|
|
- PYTHONPATH=/mars-titiler
|
|
# GDAL 性能优化配置
|
|
- CPL_TMPDIR=/tmp
|
|
- GDAL_CACHEMAX=75%
|
|
- GDAL_INGESTED_BYTES_AT_OPEN=32768
|
|
- GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
|
|
- GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
|
|
- GDAL_HTTP_MULTIPLEX=YES
|
|
- GDAL_HTTP_VERSION=2
|
|
- VSI_CACHE=TRUE
|
|
- VSI_CACHE_SIZE=536870912
|
|
- PYTHONWARNINGS=ignore
|
|
|
|
volumes:
|
|
# 挂载项目目录到容器
|
|
- ./app.py:/mars-titiler/app.py:ro
|
|
# 挂载数据目录
|
|
- /mnt/Data/layer_mars:/data:ro
|
|
|
|
# 可选:如果使用 gunicorn 生产环境,取消注释以下配置
|
|
# command: [
|
|
# "gunicorn",
|
|
# "-k", "uvicorn.workers.UvicornWorker",
|
|
# "app:app",
|
|
# "--bind", "0.0.0.0:8000",
|
|
# "--workers", "2",
|
|
# "--timeout", "120"
|
|
# ]
|
|
|
|
restart: unless-stopped
|