feat: 添加Redis支持和Celery任务处理
- 新增Redis服务模块用于会话状态存储和缓存 - 集成Celery用于后台任务处理 - 更新Docker Compose配置以支持开发环境 - 优化API以支持异步调用和Redis会话存储 - 更新文档以反映新的开发环境配置和使用方法
This commit is contained in:
29
api/docker-compose.dev.yml
Normal file
29
api/docker-compose.dev.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
version: '3.8'
|
||||
|
||||
# 开发环境 Docker Compose
|
||||
# 使用方法: docker-compose -f docker-compose.dev.yml up -d
|
||||
|
||||
services:
|
||||
# Redis 服务
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: life-echo-redis-dev
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data_dev:/data
|
||||
command: redis-server --appendonly yes
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: life-echo-dev
|
||||
|
||||
volumes:
|
||||
redis_data_dev:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user