mmap-tile/README.md
tsuki ceaa43f87d
Some checks are pending
Docker Build and Push / build (push) Waiting to run
update remap
2025-08-01 15:25:11 +08:00

100 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Mapp Tile Service
一个基于Rust的瓦片地图服务提供图像缓存和数据库查询功能。
## 🐳 Docker 部署
### 本地构建
```bash
# 构建镜像
docker build -t mapp-tile:latest .
# 运行容器
docker run -p 3000:3000 --env-file .env mapp-tile:latest
```
### 使用构建脚本
```bash
# 给脚本执行权限
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` 文件并配置以下环境变量:
```env
DATABASE_URL=postgresql://username:password@localhost:5432/database
LOCAL_OSS=https://your-oss-endpoint.com
```
## 🔧 开发
### 本地运行
```bash
# 安装依赖
cargo build
# 运行开发服务器
cargo run
```
### 测试
```bash
# 运行测试
cargo test
# 运行Clippy检查
cargo clippy
# 检查代码格式
cargo fmt --check
```
## 📦 镜像标签说明
- `latest`: 最新版本
- `main`: main分支的最新构建
- `v1.0.0`: 语义化版本标签
- `sha-abc123`: 基于提交哈希的标签
## 🔍 健康检查
服务提供健康检查端点:
```bash
curl http://localhost:3000/api/v1/health
```
## <20><> 许可证
MIT License