Files
system-backu/docker-compose.yml
T
publ 4e3a4b4602 feat: 数据备份管理系统 v0.1.0
带 Web 操作界面的备份系统,支持:
- 数据源:MySQL 数据库(mysqldump)、服务器目录(tar.gz)
- 存储目标:本地目录、S3 兼容对象存储(MinIO/Ceph/AWS S3)
- 触发方式:手动 + Cron 定时调度(APScheduler)
- 备份还原:MySQL 库、目录
- JWT 登录认证 + Fernet 字段加密
- 保留策略:按数量 + 按天数双重清理

技术栈:FastAPI + SQLAlchemy 2 + APScheduler + aioboto3;
前端 Vite + React 18 + TypeScript + Ant Design 5 + Zustand。
Docker Compose 一键起。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-22 18:27:41 +08:00

48 lines
1.1 KiB
YAML

version: "3.9"
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: backup-system/backend:latest
container_name: backup-backend
env_file:
- .env
environment:
# 容器内默认存储根目录
STORAGE_LOCAL_ROOT: /app/data/backups
DATABASE_URL: sqlite:////app/data/backup.db
volumes:
- backend-data:/app/data
- backend-logs:/app/logs
# 默认 local storage 根;若自定义 local storage 路径,可再挂载
- local-backups:/app/data/backups
ports:
- "8765:8000"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 5s
retries: 5
start_period: 20s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: backup-system/frontend:latest
container_name: backup-frontend
ports:
- "5173:80"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
volumes:
backend-data:
backend-logs:
local-backups: