Skip to content

Commit

Permalink
更新docker总结
Browse files Browse the repository at this point in the history
  • Loading branch information
onresize committed Apr 19, 2024
1 parent 7ab59a9 commit bfef76b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
Binary file added docs/.vuepress/public/AA_mdPics/docker2.min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion docs/技术总结/踩坑总结/docker前端篇.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description: docker前端篇
<br />
[Harbor私服镜像存储仓库](https://goharbor.io/)
<br />
[笔记参考](https://gitee.com/onresize/docker-compose)
<!-- [笔记参考](https://gitee.com/onresize/docker-compose) -->

> 本文针对前端开发做的一篇docker入门总结
Expand Down Expand Up @@ -203,6 +203,13 @@ EXPOSE 3000
# 运行应用程序的命令
CMD ["yarn", "koa"]
```
Dockerfile 文件中指定的 WORKDIR /app其实就是这个构建的镜像中 node 项目源码的位置
<br >
注:有个应用场景、当前构建的这个 `node` 镜像是涵盖了当部署在服务器上运行的日志持久化文件在这个 `/app/logger/logs` 下、当程序出现问题时、这样就可以直接可以用 `docker desktop` 去查看图形化查看这个日志文件做排查
<p align="center">
<img src="/AA_mdPics/docker2.min.png">
</p>

node程序中连接mongodb数据库的 `db.js` 文件
```js
const Mongoose = require('mongoose')
Expand Down
3 changes: 3 additions & 0 deletions docs/技术总结/踩坑总结/git篇.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ git config --global --get https.proxy
// 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

// git 无法将空文件夹上传至远程仓库
// 解决办法:在空文件夹下创建一个 .gitkeep 空文件
```

### `11.git add常用命令`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ description: ncc打包加密node服务为单体文件

> 本文作者:[onresize](https://github.com/onresize)

#### 用途

- 加密打包、避免源码暴露
> ncc 将 node 加密混淆打包
[代码示例](https://gitee.com/onresize/mp4-to-hls-flv-server)
- 加密混淆打包、避免源码暴露
- 优点:单体文件、有node环境就能直接运行、不需要安装依赖


#### 安装

```bash
Expand Down
4 changes: 3 additions & 1 deletion docs/技术总结/踩坑总结/node总结.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ description: node总结

[node内置http模块](https://blog.csdn.net/weixin_46809263/article/details/133877683)

[内置的http 和 express 和 koa的区别](https://blog.csdn.net/weixin_58555796/article/details/130331966)
[内置的http 和 express 和 koa的区别](https://blog.csdn.net/weixin_58555796/article/details/130331966)

[koa-node代码示例](https://gitee.com/onresize/koa-node)

0 comments on commit bfef76b

Please sign in to comment.