修改docker环境测试

This commit is contained in:
龙澳
2026-02-25 16:09:25 +08:00
parent 11dab20d38
commit 891c253468
3 changed files with 15 additions and 9 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
# custom gitignore for python projects
.claude/
.vscode/
data/
# ---> Python
# Byte-compiled / optimized / DLL files

View File

@@ -1,6 +1,7 @@
services:
mars-titiler:
image: ghcr.io/developmentseed/titiler:latest
container_name: mars-titiler
ports:
- "8001:8000"
@@ -33,9 +34,9 @@ services:
volumes:
# 挂载项目目录到容器
- .:/mars-titiler
- ./app.py:/mars-titiler/app.py:ro
# 挂载数据目录
- /home/la/studio/cesium/rio-tiler-tms/data:/data:ro
- ./data:/data:ro
# 可选:如果使用 gunicorn 生产环境,取消注释以下配置
# command: [

View File

@@ -7,10 +7,14 @@ from pathlib import Path
# 默认数据路径
DEFAULT_DATA = (
Path(__file__).parent.parent
/ "rio-tiler-tms"
/ "data"
/ "Mars_MGS_MOLA_ClrShade_merge_global_463m.tif"
Path("/data") /
"mola/Mars_MGS_MOLA_ClrShade_merge_global_463m.ptiff"
)
# 默认数据路径
DEFAULT_DATA = (
Path("/data") /
"moric_global/HX1_GRAS_MoRIC_DOM_076m_Global_00N00E_A.ptiff"
)
@@ -108,9 +112,9 @@ if __name__ == "__main__":
else:
data_path = str(DEFAULT_DATA)
if not Path(data_path).exists():
print(f"❌ 错误: 数据文件不存在: {data_path}")
sys.exit(1)
# if not Path(data_path).exists():
# print(f"❌ 错误: 数据文件不存在: {data_path}")
# sys.exit(1)
# 测试服务器是否在运行
try: