Go to file
Tsuki 0215aa6aef
Some checks failed
Docker Build and Push / build (push) Has been cancelled
fix
2025-08-01 23:17:08 +08:00
.github/workflows dont build at arm platform 2025-08-01 18:17:12 +08:00
.sqlx init 2025-07-30 21:33:14 +08:00
src fix 2025-08-01 23:17:08 +08:00
.dockerignore sync 2025-08-01 17:31:24 +08:00
.gitignore update remap 2025-08-01 15:25:11 +08:00
Cargo.lock update remap 2025-08-01 15:25:11 +08:00
Cargo.toml update remap 2025-08-01 15:25:11 +08:00
Dockerfile sync 2025-08-01 17:31:24 +08:00
README.md update remap 2025-08-01 15:25:11 +08:00

Mapp Tile Service

一个基于Rust的瓦片地图服务提供图像缓存和数据库查询功能。

🐳 Docker 部署

本地构建

# 构建镜像
docker build -t mapp-tile:latest .

# 运行容器
docker run -p 3000:3000 --env-file .env mapp-tile:latest

使用构建脚本

# 给脚本执行权限
chmod +x docker-build.sh

# 运行构建脚本
./docker-build.sh

🚀 GitHub Actions

本项目配置了以下GitHub Actions工作流

1. Docker构建和推送 (docker.yml)

  • 在推送到main/master分支时自动构建Docker镜像
  • 支持多平台构建amd64, arm64
  • 自动推送到GitHub Container Registry
  • 支持语义化版本标签

2. 测试 (test.yml)

  • 运行Rust项目的单元测试
  • 代码格式检查
  • Clippy静态分析
  • 包含PostgreSQL服务用于集成测试

3. 安全扫描 (security.yml)

  • 依赖漏洞扫描cargo audit
  • 许可证检查cargo-deny
  • 容器镜像安全扫描Trivy
  • 每周自动运行

📋 环境变量

创建 .env 文件并配置以下环境变量:

DATABASE_URL=postgresql://username:password@localhost:5432/database
LOCAL_OSS=https://your-oss-endpoint.com

🔧 开发

本地运行

# 安装依赖
cargo build

# 运行开发服务器
cargo run

测试

# 运行测试
cargo test

# 运行Clippy检查
cargo clippy

# 检查代码格式
cargo fmt --check

📦 镜像标签说明

  • latest: 最新版本
  • main: main分支的最新构建
  • v1.0.0: 语义化版本标签
  • sha-abc123: 基于提交哈希的标签

🔍 健康检查

服务提供健康检查端点:

curl http://localhost:3000/api/v1/health

<EFBFBD><EFBFBD> 许可证

MIT License