- Add Redis service (docker-compose) for caching accounts, messages, payment status - Cache accounts list (5min), messages (3min), payment status (10min) - Auto-invalidate cache on import/delete/payment-check/note-update - Add refresh button to email list panel (force re-fetch from IMAP) - Messages API supports refresh=true param to bypass cache - New cache.py module with RedisCache class Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
version: '3.8'
|
||
|
||
services:
|
||
outlook-mail-system:
|
||
build: .
|
||
container_name: outlook-mail-automation
|
||
ports:
|
||
- "5000:5001"
|
||
volumes:
|
||
# 挂载配置文件,便于修改邮箱配置
|
||
- ./config.txt:/app/config.txt
|
||
# 持久化SQLite数据库,防止容器重建丢失数据
|
||
- ./data:/app/data
|
||
# 可选:挂载日志目录
|
||
- ./logs:/app/logs
|
||
environment:
|
||
# 管理员令牌,可以通过环境变量设置
|
||
- ADMIN_TOKEN=${ADMIN_TOKEN:-admin123}
|
||
- REDIS_URL=redis://redis:6379/0
|
||
# 可选:设置时区
|
||
- TZ=Asia/Shanghai
|
||
depends_on:
|
||
redis:
|
||
condition: service_healthy
|
||
restart: unless-stopped
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost:5001/"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 40s
|
||
networks:
|
||
- outlook-mail-network
|
||
|
||
redis:
|
||
image: redis:7-alpine
|
||
container_name: outlook-redis
|
||
command: redis-server --maxmemory 64mb --maxmemory-policy allkeys-lru
|
||
volumes:
|
||
- redis_data:/data
|
||
restart: unless-stopped
|
||
healthcheck:
|
||
test: ["CMD", "redis-cli", "ping"]
|
||
interval: 10s
|
||
timeout: 3s
|
||
retries: 3
|
||
networks:
|
||
- outlook-mail-network
|
||
|
||
volumes:
|
||
redis_data:
|
||
|
||
networks:
|
||
outlook-mail-network:
|
||
driver: bridge
|