fastapi-demo/.env.prod

48 lines
1023 B
Plaintext

# 生产环境配置
ENVIRONMENT=production
DEBUG=False
LOG_LEVEL=info
# 服务器配置
HOST=127.0.0.1
PORT=8000
WORKERS=4
RELOAD=False
# 生产环境关闭 API 文档
DOCS_URL=
REDOC_URL=
# 数据库 - 生产环境使用 PostgreSQL
DATABASE_URL=postgresql://user:password@localhost/prod_db
DB_ECHO=False
DB_POOL_SIZE=20
DB_MAX_OVERFLOW=30
# Redis 配置
REDIS_HOST=prod-redis-server
REDIS_PASSWORD=your-redis-password
# CORS 严格限制
CORS_ORIGINS=["https://yourdomain.com","https://www.yourdomain.com"]
# JWT 配置 - 生产环境必须使用强密钥
SECRET_KEY=your-super-secret-key-at-least-32-characters-long
ACCESS_TOKEN_EXPIRE_MINUTES=15
REFRESH_TOKEN_EXPIRE_DAYS=7
# 邮件配置
SMTP_HOST=smtp.yourdomain.com
SMTP_PORT=587
SMTP_USER=noreply@yourdomain.com
SMTP_PASSWORD=your-smtp-password
SMTP_FROM=noreply@yourdomain.com
# 监控配置
SENTRY_DSN=https://your-sentry-dsn@sentry.io/project-id
PROMETHEUS_ENABLED=True
# 限流配置
RATE_LIMIT_ENABLED=True
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_PERIOD=60