Skip to content

Commit 6bbe465

Browse files
committed
build(docker): 优化Docker配置并添加生产环境支持
重构所有Docker相关配置,包括: - 添加多阶段构建优化镜像大小 - 实现生产环境配置(docker-compose.prod.yml) - 新增部署脚本(deploy.sh) - 完善Docker文档说明 - 添加健康检查和资源限制 - 实现非root用户运行容器 优化构建性能并增强安全性,为生产环境部署做好准备
1 parent 2699488 commit 6bbe465

File tree

11 files changed

+1691
-100
lines changed

11 files changed

+1691
-100
lines changed

.env.example

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Environment Variables Template
2+
# Copy this file to .env and fill in your actual values
3+
4+
# Database Configuration
5+
POSTGRES_PASSWORD=your_secure_password_here
6+
POSTGRES_USER=postgres
7+
POSTGRES_DB=Blog
8+
DATABASE_URL=postgres://postgres:your_secure_password_here@postgres:5432/Blog
9+
10+
# JWT Configuration
11+
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production_with_minimum_32_characters
12+
13+
# API Configuration
14+
PUBLIC_API_BASE_URL=http://localhost:8080/api
15+
INTERNAL_API_BASE_URL=http://backend:8080/api
16+
17+
# Frontend Configuration
18+
HOST=0.0.0.0
19+
PORT=4321
20+
21+
# CORS Configuration (comma-separated)
22+
ALLOWED_ORIGINS=http://localhost:4321,https://yourdomain.com,http://frontend:4321
23+
24+
# Production Settings
25+
NODE_ENV=production

0 commit comments

Comments
 (0)