nodebbs 0.0.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,120 +0,0 @@
1
- # 生产环境 Docker Compose 覆盖配置
2
- # 使用方式: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
3
- # 本文件只包含与 docker-compose.yml 的差异部分
4
-
5
- services:
6
- # PostgreSQL 数据库 - 生产环境优化
7
- postgres:
8
- restart: always
9
- ports: [] # 生产环境不暴露端口到主机,只在内部网络访问
10
- environment:
11
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} # 生产环境必须设置强密码
12
- healthcheck:
13
- interval: 30s
14
- timeout: 10s
15
- retries: 5
16
- start_period: 40s
17
- deploy:
18
- resources:
19
- limits:
20
- cpus: '1'
21
- memory: 512M
22
- reservations:
23
- cpus: '0.25'
24
- memory: 256M
25
- logging:
26
- driver: "json-file"
27
- options:
28
- max-size: "10m"
29
- max-file: "3"
30
-
31
- # Redis 缓存 - 生产环境优化
32
- redis:
33
- restart: always
34
- command: >
35
- redis-server
36
- --requirepass ${REDIS_PASSWORD}
37
- --appendonly yes
38
- --appendfsync everysec
39
- --maxmemory 256mb
40
- --maxmemory-policy allkeys-lru
41
- ports: [] # 生产环境不暴露端口到主机
42
- healthcheck:
43
- interval: 30s
44
- timeout: 10s
45
- retries: 5
46
- start_period: 20s
47
- deploy:
48
- resources:
49
- limits:
50
- cpus: '0.5'
51
- memory: 256M
52
- reservations:
53
- cpus: '0.1'
54
- memory: 128M
55
- logging:
56
- driver: "json-file"
57
- options:
58
- max-size: "10m"
59
- max-file: "3"
60
-
61
- # API 服务 - 生产环境优化
62
- api:
63
- restart: always
64
- environment:
65
- USER_CACHE_TTL: ${USER_CACHE_TTL:-300} # 生产环境缓存时间更长
66
- JWT_SECRET: ${JWT_SECRET} # 生产环境必须设置
67
- CORS_ORIGIN: ${CORS_ORIGIN} # 生产环境必须明确设置
68
- APP_URL: ${APP_URL} # 生产环境实际域名
69
- NODE_OPTIONS: "--max-old-space-size=512" # 限制 Node.js 内存使用
70
- volumes:
71
- - api_uploads:/app/apps/api/uploads # 生产环境不挂载源代码
72
- healthcheck:
73
- start_period: 60s
74
- deploy:
75
- resources:
76
- limits:
77
- cpus: '1'
78
- memory: 768M
79
- reservations:
80
- cpus: '0.3'
81
- memory: 384M
82
- logging:
83
- driver: "json-file"
84
- options:
85
- max-size: "20m"
86
- max-file: "5"
87
-
88
- # Web 前端服务 - 生产环境优化
89
- web:
90
- restart: always
91
- build:
92
- args:
93
- NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
94
- NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
95
- environment:
96
- NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
97
- NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
98
- NODE_OPTIONS: "--max-old-space-size=512" # 限制 Node.js 内存使用
99
- healthcheck:
100
- start_period: 60s
101
- deploy:
102
- resources:
103
- limits:
104
- cpus: '1'
105
- memory: 768M
106
- reservations:
107
- cpus: '0.3'
108
- memory: 384M
109
- logging:
110
- driver: "json-file"
111
- options:
112
- max-size: "20m"
113
- max-file: "5"
114
-
115
- # 网络 - 生产环境使用固定子网
116
- networks:
117
- nodebbs-network:
118
- ipam:
119
- config:
120
- - subnet: 172.28.0.0/16
@@ -1,14 +0,0 @@
1
- -- PostgreSQL 初始化脚本
2
- -- 这个脚本会在数据库首次创建时执行
3
-
4
- -- 创建扩展(如果需要)
5
- -- CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
6
- -- CREATE EXTENSION IF NOT EXISTS "pg_trgm";
7
-
8
- -- 设置时区
9
- SET timezone = 'Asia/Shanghai';
10
-
11
- -- 数据库已由 POSTGRES_DB 环境变量创建
12
- -- 这里可以添加其他初始化 SQL
13
-
14
- \echo '数据库初始化完成'