feat: v0.3.3 - 清理代码结构,删除common层,保留core层企业级基础设施
- 删除common层业务代码(将通过real-business-logic-generator.js重新生成) - 清理重复的core层生成工具 - 保留完整的企业级core层基础设施(Security/Cache/Tracing/Event/Queue/Health) - 版本号升级到0.3.3 - 项目架构现已完整,接下来专注优化PHP到TypeScript语法转换
This commit is contained in:
16
wwjcloud/docker/.dockerignore
Normal file
16
wwjcloud/docker/.dockerignore
Normal file
@@ -0,0 +1,16 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
dist
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
.env
|
||||
.env.local
|
||||
.env.production
|
||||
coverage
|
||||
.nyc_output
|
||||
test
|
||||
*.test.js
|
||||
*.spec.js
|
||||
23
wwjcloud/docker/Dockerfile
Normal file
23
wwjcloud/docker/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# 使用Node.js官方镜像作为基础镜像
|
||||
FROM node:18-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制package.json和package-lock.json
|
||||
COPY package*.json ./
|
||||
|
||||
# 安装依赖
|
||||
RUN npm ci --only=production
|
||||
|
||||
# 复制源代码
|
||||
COPY . .
|
||||
|
||||
# 构建应用
|
||||
RUN npm run build
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 启动应用
|
||||
CMD ["npm", "run", "start:prod"]
|
||||
45
wwjcloud/docker/docker-compose.yml
Normal file
45
wwjcloud/docker/docker-compose.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# NestJS应用
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_URL=mysql://root:password@db:3306/wwjcloud
|
||||
- REDIS_URL=redis://redis:6379
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
# MySQL数据库
|
||||
db:
|
||||
image: mysql:8.0
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=password
|
||||
- MYSQL_DATABASE=wwjcloud
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
# Redis缓存
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- "6379:6379"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
44
wwjcloud/docker/mysql/conf/my.cnf
Normal file
44
wwjcloud/docker/mysql/conf/my.cnf
Normal file
@@ -0,0 +1,44 @@
|
||||
[mysqld]
|
||||
# 基本设置
|
||||
default-storage-engine=INNODB
|
||||
character-set-server=utf8mb4
|
||||
collation-server=utf8mb4_general_ci
|
||||
init_connect='SET NAMES utf8mb4'
|
||||
|
||||
# 连接设置
|
||||
max_connections=1000
|
||||
max_connect_errors=1000
|
||||
wait_timeout=28800
|
||||
interactive_timeout=28800
|
||||
|
||||
# 缓存设置
|
||||
key_buffer_size=32M
|
||||
max_allowed_packet=128M
|
||||
table_open_cache=2000
|
||||
sort_buffer_size=2M
|
||||
read_buffer_size=2M
|
||||
read_rnd_buffer_size=8M
|
||||
myisam_sort_buffer_size=64M
|
||||
thread_cache_size=8
|
||||
query_cache_size=32M
|
||||
tmp_table_size=64M
|
||||
|
||||
# InnoDB设置
|
||||
innodb_buffer_pool_size=128M
|
||||
innodb_log_file_size=32M
|
||||
innodb_log_buffer_size=8M
|
||||
innodb_flush_log_at_trx_commit=1
|
||||
innodb_lock_wait_timeout=50
|
||||
|
||||
# 日志设置
|
||||
log-error=/var/log/mysql/error.log
|
||||
slow_query_log=1
|
||||
slow_query_log_file=/var/log/mysql/slow.log
|
||||
long_query_time=2
|
||||
|
||||
# 时区设置
|
||||
default-time-zone='+8:00'
|
||||
|
||||
# 安全设置
|
||||
skip-name-resolve
|
||||
explicit_defaults_for_timestamp=true
|
||||
11
wwjcloud/docker/mysql/init/01-init.sql
Normal file
11
wwjcloud/docker/mysql/init/01-init.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 创建数据库和用户
|
||||
CREATE DATABASE IF NOT EXISTS `wwjcloud` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
CREATE USER IF NOT EXISTS 'wwjcloud'@'%' IDENTIFIED BY '123456';
|
||||
GRANT ALL PRIVILEGES ON `wwjcloud`.* TO 'wwjcloud'@'%';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- 使用wwjcloud数据库
|
||||
USE `wwjcloud`;
|
||||
|
||||
-- 导入数据库结构
|
||||
SOURCE /docker-entrypoint-initdb.d/wwjcloud.sql;
|
||||
4960
wwjcloud/docker/mysql/init/wwjcloud.sql
Normal file
4960
wwjcloud/docker/mysql/init/wwjcloud.sql
Normal file
File diff suppressed because it is too large
Load Diff
77
wwjcloud/docker/redis/redis.conf
Normal file
77
wwjcloud/docker/redis/redis.conf
Normal file
@@ -0,0 +1,77 @@
|
||||
# Redis配置文件
|
||||
|
||||
# 网络设置
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
timeout 0
|
||||
tcp-keepalive 300
|
||||
|
||||
# 通用设置
|
||||
daemonize no
|
||||
supervised no
|
||||
pidfile /var/run/redis_6379.pid
|
||||
loglevel notice
|
||||
logfile ""
|
||||
databases 16
|
||||
|
||||
# 持久化设置
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
stop-writes-on-bgsave-error yes
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
dbfilename dump.rdb
|
||||
dir /data
|
||||
|
||||
# 复制设置
|
||||
replica-serve-stale-data yes
|
||||
replica-read-only yes
|
||||
repl-diskless-sync no
|
||||
repl-diskless-sync-delay 5
|
||||
repl-ping-replica-period 10
|
||||
repl-timeout 60
|
||||
repl-disable-tcp-nodelay no
|
||||
repl-backlog-size 1mb
|
||||
repl-backlog-ttl 3600
|
||||
|
||||
# 安全设置
|
||||
# requirepass foobared
|
||||
# rename-command FLUSHDB ""
|
||||
# rename-command FLUSHALL ""
|
||||
# rename-command KEYS ""
|
||||
|
||||
# 客户端设置
|
||||
maxclients 10000
|
||||
maxmemory 256mb
|
||||
maxmemory-policy allkeys-lru
|
||||
|
||||
# 慢查询日志
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
|
||||
# 延迟监控
|
||||
latency-monitor-threshold 0
|
||||
|
||||
# 事件通知
|
||||
notify-keyspace-events ""
|
||||
|
||||
# 高级配置
|
||||
hash-max-ziplist-entries 512
|
||||
hash-max-ziplist-value 64
|
||||
list-max-ziplist-size -2
|
||||
list-compress-depth 0
|
||||
set-max-intset-entries 512
|
||||
zset-max-ziplist-entries 128
|
||||
zset-max-ziplist-value 64
|
||||
hll-sparse-max-bytes 3000
|
||||
stream-node-max-bytes 4096
|
||||
stream-node-max-entries 100
|
||||
activerehashing yes
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit replica 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
hz 10
|
||||
dynamic-hz yes
|
||||
aof-rewrite-incremental-fsync yes
|
||||
rdb-save-incremental-fsync yes
|
||||
Reference in New Issue
Block a user