Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose部署教程 #52

Closed
Jonnyan404 opened this issue May 21, 2022 · 17 comments
Closed

docker-compose部署教程 #52

Jonnyan404 opened this issue May 21, 2022 · 17 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Jonnyan404
Copy link
Contributor

Jonnyan404 commented May 21, 2022

已提交PR #53 ,有需要的可自行拉取最新代码执行.

项目作者已合并,请前往项目主页查看教程.

@fantasticit
Copy link
Owner

厉害!

  • /path/to/you/dir/config:/app/packages/config/yaml # 请注意修改 /path/to/you/dir 为云策文档配置文件目录

这里需要注意下,现在已经改成加载项目根目录的 dev.yaml 或者 prod.yaml 了。

@fantasticit fantasticit added enhancement New feature or request good first issue Good for newcomers labels May 21, 2022
@Jonnyan404
Copy link
Contributor Author

Jonnyan404 commented May 21, 2022

厉害!

  • /path/to/you/dir/config:/app/packages/config/yaml # 请注意修改 /path/to/you/dir 为云策文档配置文件目录

这里需要注意下,现在已经改成加载项目根目录的 dev.yaml 或者 prod.yaml 了。

不要不要不要放在根目录,不然配置文件没法单独映射出来,不方便 docker 挂载修改配置配件.配置文件最好单独一个目录.还好我是你修改前的源代码~

@fantasticit
Copy link
Owner

放在 packages/config/yaml 下太深了。在根目录新建 config 文件夹存放 yaml 配置?

@Jonnyan404
Copy link
Contributor Author

放在 packages/config/yaml 下太深了。在根目录新建 config 文件夹存放 yaml 配置?

可以的,只要是单独一个目录就行.

@Jonnyan404
Copy link
Contributor Author

放在 packages/config/yaml 下太深了。在根目录新建 config 文件夹存放 yaml 配置?

另外请问你那个生产环境怎么玩? build之后,还可以依赖外部配置文件吗? build之后,build之前的各种依赖是否可以删掉?

@Jonnyan404
Copy link
Contributor Author

放在 packages/config/yaml 下太深了。在根目录新建 config 文件夹存放 yaml 配置?

另外请问你那个生产环境怎么玩? build之后,还可以依赖外部配置文件吗? build之后,build之前的各种依赖是否可以删掉?
我不太懂nodejs

@fantasticit
Copy link
Owner

node_modulespackage.jsonnext.config.jsnest-cli.json 不可以删,我后面写个脚本,把生产环境所需的文件统一输出到 output 目录。

@Jonnyan404
Copy link
Contributor Author

node_modulespackage.jsonnext.config.jsnest-cli.json 不可以删,我后面写个脚本,把生产环境所需的文件统一输出到 output 目录。

好的

fantasticit added a commit that referenced this issue May 21, 2022
@fantasticit fantasticit added the help wanted Extra attention is needed label May 21, 2022
@Jonnyan404
Copy link
Contributor Author

Jonnyan404 commented May 22, 2022

node_modulespackage.jsonnext.config.jsnest-cli.json 不可以删,我后面写个脚本,把生产环境所需的文件统一输出到 output 目录。

我发现必须在build之前就修改api接口相关的IP,否则就算后面改了配置文件,配置也不生效了. 是设计如此吗?
期望的结果:

  • client端的相关参数可以在运行时通过配置文件读取.

@fantasticit
Copy link
Owner

因为配置读取依赖文件读取能力,但是前端在运行时是没有这个能力的,所以目前是打包时注入环境变量,体现为打包后的前端代码里相关配置都已是常量注入。见 define-plugin

@Jonnyan404
Copy link
Contributor Author

见 define-plugin

好的,懂了,在改了,稍等提个pr上来.

@Jonnyan404
Copy link
Contributor Author

Jonnyan404 commented May 22, 2022

@fantasticit 再请教一下,那个jwt如何生成? 有什么要求吗?
换句话说就是,生产环境下有没有必要修改?

@fantasticit
Copy link
Owner

就是加盐,不改也没多大影响。

@Jonnyan404
Copy link
Contributor Author

就是加盐,不改也没多大影响。

ok,已提交PR+使用说明+优化首页说明文档.

@Jackiexiao
Copy link

可以考虑 github ci 自动将编译好的 docker 上传到 dockerhub 中,这样用户可以不用从头编起

@Jonnyan404
Copy link
Contributor Author

可以考虑 github ci 自动将编译好的 docker 上传到 dockerhub 中,这样用户可以不用从头编起

不考虑,不支持!

@Jackiexiao
Copy link

Jackiexiao commented May 23, 2022

哦...构建镜像有个参数是 填ip & 域名 的 EIP... 如果改成 127.0.0.1 应该就可以镜像通用,然后 caddy /nginx 反向代理,但这个 EIP 动态传入比较好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants