修改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 # custom gitignore for python projects
.claude/ .claude/
.vscode/ .vscode/
data/
# ---> Python # ---> Python
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files

View File

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

View File

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