7d752073fb
- 添加 JWT_SECRET 和 ADMIN_RESET_PASSWORD_KEY 安全检查,防止使用默认值 - 创建 docker-compose.prod.yml 和 docker-compose.prod.env.example,支持独立部署 - 添加 Nginx 反向代理配置示例,支持 HTTPS 和域名绑定 - 更新部署文档,将 Docker Hub 部署方式放在首位 - 添加多架构构建支持(amd64、arm64) - 优化部署文档结构,提供更清晰的部署指南
50 lines
1.8 KiB
Bash
50 lines
1.8 KiB
Bash
# PolyHermes 生产环境配置文件示例
|
|
#
|
|
# 使用方法:
|
|
# 1. 复制此文件为 .env: cp docker-compose.prod.env.example .env
|
|
# 2. 修改以下配置项(特别是安全相关的密钥)
|
|
# 3. 运行: docker-compose -f docker-compose.prod.yml up -d
|
|
|
|
# ============================================
|
|
# 数据库配置
|
|
# ============================================
|
|
DB_URL=jdbc:mysql://mysql:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8&allowPublicKeyRetrieval=true
|
|
DB_USERNAME=root
|
|
DB_PASSWORD=your_database_password_here
|
|
|
|
# ============================================
|
|
# Spring Profile
|
|
# ============================================
|
|
SPRING_PROFILES_ACTIVE=prod
|
|
|
|
# ============================================
|
|
# 服务器端口(对外暴露的端口)
|
|
# ============================================
|
|
SERVER_PORT=80
|
|
|
|
# ============================================
|
|
# MySQL 端口(可选,用于外部连接,默认 3307 避免与本地 MySQL 冲突)
|
|
# ============================================
|
|
MYSQL_PORT=3307
|
|
|
|
# ============================================
|
|
# Polygon RPC
|
|
# ============================================
|
|
POLYGON_RPC_URL=https://polygon-rpc.com
|
|
|
|
# ============================================
|
|
# 安全配置(⚠️ 必须修改,不能使用默认值)
|
|
# ============================================
|
|
# 生成随机密钥命令:
|
|
# openssl rand -hex 32 # 用于 ADMIN_RESET_PASSWORD_KEY
|
|
# openssl rand -hex 64 # 用于 JWT_SECRET
|
|
|
|
JWT_SECRET=your-jwt-secret-key-here-change-in-production
|
|
ADMIN_RESET_PASSWORD_KEY=your-admin-reset-key-here-change-in-production
|
|
|
|
# ============================================
|
|
# 加密密钥(可选,用于加密存储私钥和 API Key)
|
|
# ============================================
|
|
# CRYPTO_SECRET_KEY=your-crypto-secret-key-here
|
|
|