Skip to content

像打包前端代码一样打包后端代码,以便在创建 docker 镜像时过滤 node_modules,使镜像变小,加快 push 速度。

Notifications You must be signed in to change notification settings

taichenglu/docker-node-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs 后端项目文件打包

(koa2 的打包可以看这里

应用场景

使用 webpack,像打包前端代码一样打包后端代码,以便在创建 docker 镜像时过滤 node_modules,使镜像变小,加快 push 速度。

安装

npm install

非打包运行

npm start

访问

http://localhost:3000

打包

npm run build

打包后运行(运行后可以访问)

npm run deploy

docker build & run(确保本地已运行 docker)

npm run docker

运行后查看 PORTS 列,复制地址访问,例如:0.0.0.0:32784

About

像打包前端代码一样打包后端代码,以便在创建 docker 镜像时过滤 node_modules,使镜像变小,加快 push 速度。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages