docker-webman-jsonrpc/README.md
2023-10-28 10:21:35 +08:00

32 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 基于docker的webman-jsonrpc
我们在`php:8.1-cli`基础上安装了运行webman必要的一些扩展和开发中常用的扩展以及composer制作成`workerman:8.1`镜像因此在开发环境中不需要再额外配置php环境直接写业务代码即可。
## 依赖
只要系统环境中有docker即可不需要安装php环境
## 使用方法
```sh
# 启动
./start
# composer
./composer install
./conposer require xxxx
```
## 一些有用的文件
| 文件 | 作用 | 用法或说明 |
|---|---|---|
|composer|调起容器中的`composer`命令的shell脚本|用法与主机中的compose完全一致`./composer $args...`|
|run|调起容器中的`php start.php`命令的shell脚本支持一系统参数并支持-d模式|`./run help`可以查看用法|
|docker-compose.yml|运行容器的编排文件|一般不需要理会这个文件composer和start脚本都需要依赖这个文件|
|docker.conf|定义运行服务的容器名称和使用的镜像版本|注意container_name不要与系统中其他服务的容器重名|
|php.ini|映射到容器中的php.ini配置文件|容器中已经安装的扩展都有单独的配置文件,这里不会有体现|
## 服务端口
在.env文件中可以定义服务端口默认情况下docker容器是在host网络下启动的当然实际使用中也可以改成端口映射模式。