Skip to content

Commit

Permalink
移除cross-env依赖,简化启动命令
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwei committed Sep 29, 2024
1 parent 6459706 commit e7265bc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 61 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ COPY dist ./dist

# 安装项目依赖
RUN npm install pnpm -g
# 下载cross-env
RUN pnpm install cross-env
# 使用pnpm安装生产依赖
RUN pnpm install

# 暴露应用端口
EXPOSE 3001

# 启动应用
CMD ["npx", "cross-env", "NODE_ENV=production", "node", "src/server/main.js"]
CMD ["npm", "start"]
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"start": "cross-env NODE_ENV=production node src/server/main.js",
"start": "NODE_ENV=production node src/server/main.js",
"dev": "nodemon src/server/main.js -w src/server",
"build": "vite build"
},
Expand All @@ -13,7 +13,6 @@
"express": "^4.18.2",
"node-cache": "^5.1.2",
"nodemon": "^3.1.0",
"cross-env": "^7.0.3",
"multiparty": "^4.2.3",
"vue": "^3.3.8",
"vue-router": "4"
Expand Down
56 changes: 0 additions & 56 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7265bc

Please sign in to comment.