fix: 修复docker启动问题
This commit is contained in:
parent
96ca8b55ed
commit
e665882d25
@ -6,14 +6,14 @@
|
||||
"scripts": {
|
||||
"copy": "mkdir -p ./build/ && cp -rf ./src/* ./build/",
|
||||
"build": "tsc",
|
||||
"launch:local": "npm run build && SERVER_ENV=local node ./build/index.js",
|
||||
"launch:dev": "npm run build && SERVER_ENV=dev node ./build/index.js",
|
||||
"start:stable": "SERVER_ENV=stable node ./build/index.js",
|
||||
"start:preonline": "SERVER_ENV=preonline node ./build/index.js",
|
||||
"start:online": "SERVER_ENV=online node ./build/index.js",
|
||||
"launch:local": "SERVER_ENV=local npx ts-node ./src/index.ts",
|
||||
"launch:dev": "SERVER_ENV=dev npx ts-node ./src/index.ts",
|
||||
"start:stable": "npm run copy && npm run build && SERVER_ENV=stable node ./build/index.js",
|
||||
"start:preonline": "npm run copy && npm run build && SERVER_ENV=preonline node ./build/index.js",
|
||||
"start:online": "npm run copy && npm run build && SERVER_ENV=online node ./build/index.js",
|
||||
"start": "npm run start:online",
|
||||
"local": "npx ts-node scripts/run-local.ts",
|
||||
"dev": "npm run copy && nodemon -e js,mjs,json,ts --exec 'npm run launch:dev' --watch ./src"
|
||||
"dev": "nodemon -e js,mjs,json,ts --exec 'npm run launch:dev' --watch ./src"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.2.1",
|
||||
|
@ -9,7 +9,7 @@ async function startServerAndRunScript() {
|
||||
console.log('MongoDB Memory Server started:', mongoUri);
|
||||
|
||||
// 通过 nodemon 运行另一个脚本,并传递 MongoDB 连接 URL 作为环境变量
|
||||
const nodemon = exec(`npm run copy && nodemon -e js,mjs,json,ts --exec 'xiaojuSurveyMongoUrl=${mongoUri} npm run launch:local' --watch ./src`);
|
||||
const nodemon = exec(`nodemon -e js,mjs,json,ts --exec 'xiaojuSurveyMongoUrl=${mongoUri} npm run launch:local' --watch ./src`);
|
||||
|
||||
nodemon.stdout?.on('data', (data) => {
|
||||
console.log(data);
|
||||
|
Loading…
Reference in New Issue
Block a user