Files
DDUp/.env.example
lzh 4c22a137cf refactor: 管理员账号存储在数据库,生产环境使用宿主机目录存储数据
- 管理员账号在数据库初始化时创建,不再从环境变量读取
  - 默认账号: admin / admin123
  - 首次启动时自动创建,请在登录后修改密码
- 移除 ADMIN_USERNAME 和 ADMIN_PASSWORD 环境变量
- 生产环境 MySQL 数据直接存储在宿主机 /opt/vitals/mysql_data
  - 便于备份和恢复
  - 更直观的数据管理
- 更新部署指南,添加 MySQL 数据目录创建和备份说明
- 更新 .env.example 和 README.md 反映新的配置方式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:16:32 +08:00

49 lines
1.4 KiB
Plaintext
Raw Permalink 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.

# Vitals 环境变量配置示例
#
# 项目支持多环境配置:
#
# 本地开发:
# 复制此文件为 .env.local 并修改配置
# 启动: docker-compose up
#
# 生产环境:
# 复制此文件为 .env.production 并修改配置
# 启动: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# ============================================
# 环境标识development | production
ENVIRONMENT=development
# ============================================
# MySQL 配置
# ============================================
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=vitals
MYSQL_PASSWORD=your_password_here
MYSQL_DATABASE=vitals
MYSQL_ROOT_PASSWORD=rootpassword
# ============================================
# 安全配置
# ============================================
# JWT 密钥(请使用随机字符串,可用 openssl rand -hex 32 生成)
JWT_SECRET=your_random_secret_key_here
# ============================================
# AI 食物识别(可选,二选一)
# ============================================
# 阿里云通义千问
DASHSCOPE_API_KEY=your_dashscope_api_key_here
# DeepSeek
# DEEPSEEK_API_KEY=your_deepseek_api_key_here
# ============================================
# 默认管理员账户
# ============================================
# 首次启动时自动创建在数据库中
# 用户名: admin
# 密码: admin123
# 请在首次登录后及时修改密码