Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuwww committed Nov 20, 2024
1 parent 58d8da4 commit 5ae6024
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

docker 作为一个开发环境提供者,在一个镜像环境中运行命令来执行本地项目,可以用作实时开发,[具体参考](https://juejin.cn/post/6932808129189150734)

1. 生成镜像:docker build -t docker-demo2-realtime-image .
1. 排除了源文件,只保留运行环境;
1. 生成镜像:`docker build -t docker-demo2-realtime-image .`
1. **排除了源文件,只保留运行环境;**
2. 查看生成的镜像
1. docker images
1. `docker images`
3. 创建容器并运行:
1. docker run -it --name docker-demo2-realtime-container -v `pwd`:/docker-demo2-realtime -p 3002:3000 docker-demo2-realtime-image /bin/bash
1. `docker run -it --name docker-demo2-realtime-container -v `pwd`:/docker-demo2-realtime -p 3002:3000 docker-demo2-realtime-image /bin/bash`

这个时候,就不是直接执行了,而是需要手动去执行命令。


1. `root@2819a69d8c51:/# cd docker-demo2-realtime/`
2. `root@2819a69d8c51:/docker-demo2-realtime# node index.js`
1. 但是仍然不能热加载,每次都需要重启;
1. node本来就需要重启;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const Koa = require('koa');
const app = new Koa();

app.use(async (ctx) => {
console.log('!!!');
ctx.body = 'Hello World!!';
console.log('!!!!!!');
ctx.body = 'Hello World!!!!!';
});

app.listen(3000);
Binary file added 15.运维操作及环境配置/nginx/nginx.xmind
Binary file not shown.
Binary file added 15.运维操作及环境配置/redis/redis.xmind
Binary file not shown.

0 comments on commit 5ae6024

Please sign in to comment.