moodist/docker-compose.optimized.yml
walle a3c95ec19b feat: 升级到 v3.0.0 - 独立音乐播放系统与 Docker 数据持久化
🎉 版本升级: 2.5.0 → 3.0.0

🎵 音乐播放系统重构:
- 独立的音乐播放系统,不影响当前选中声音
- 修复 React Hooks 调用错误
- 使用直接 Howl API 实现音频控制
- 添加播放/停止状态视觉反馈
- 组件显示逻辑完全分离

🐳 Docker 部署优化:
- 所有 compose 文件添加 SQLite 数据库挂载
- 支持 WAL 模式和并发写入
- 数据持久化,容器重启不丢失数据
- 创建详细的 Docker 数据库挂载文档

🎨 UI/UX 改进:
- 修复当前选中声音与音乐列表显示互斥问题
- 播放按钮状态动态显示
- 组件模块完全独立展示

🗄️ 数据库性能优化:
- 启用 WAL 模式提高并发性能
- 优化 SQLite 配置参数
- 添加详细日志和错误处理

📦 新增文件:
- docker-database-mount.md: Docker 数据库挂载说明文档
2025-11-19 15:21:49 +08:00

95 lines
No EOL
1.8 KiB
YAML
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.

version: '3.8'
services:
moodist:
# 使用优化的镜像名称
image: walllee/moodist:latest
container_name: moodist-app
# 重启策略
restart: unless-stopped
# 端口映射
ports:
- "8080:8080"
# 环境变量
environment:
- NODE_ENV=production
- TZ=Asia/Shanghai
# 健康检查
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# 资源限制
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
reservations:
cpus: '0.1'
memory: 32M
# 日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# 网络配置
networks:
- moodist-network
# 安全选项
security_opt:
- no-new-privileges:true
# 数据卷挂载
volumes:
# 挂载 SQLite 数据库文件目录(需要读写权限)
- ./data:/app/data:rw
# 挂载临时目录用于 SQLite WAL 文件
- moodist-temp:/tmp:rw
# 只读根文件系统(除了数据目录)
read_only: true
tmpfs:
- /var/cache/nginx
- /var/run
- /var/log/nginx
# Nginx反向代理可选
nginx-proxy:
image: nginx:alpine
container_name: moodist-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./docker/nginx-proxy/nginx.conf:/etc/nginx/nginx.conf:ro
- ./docker/nginx-proxy/ssl:/etc/nginx/ssl:ro
depends_on:
- moodist
networks:
- moodist-network
profiles:
- proxy
volumes:
moodist-temp:
driver: local
networks:
moodist-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16