docker-webman-jsonrpc/README.md
2023-11-11 13:59:37 +08:00

97 lines
2.1 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
# 初始化
./init
# composer
./composer install
./composer require xxxx
# 服务控制
./server start|restart|stop|status|reload|connections|logs
# 自动生成.env.example文件
./envexample
# 执行其它php命令
./php -m
./php webman build:bin
```
## 一些有用的文件
| 文件 | 作用 | 用法或说明 |
|---|---|---|
|composer|调起容器中的`composer`命令的shell脚本|用法与主机中的compose完全一致`./composer $args...`|
|server|服务控制脚本|`./server`可以查看用法|
|php|调起容器中的`php`命令的shell脚本|用法与主机中的php一致但注意执行`./php start.php start`命令时不要加-d参数|
|console|简化的`php webman`命令|执行`./console build`命令可以直接把项目打包成bin文件其它用法与webman/console命令行插件一致|
|docker-compose.yml|运行容器的编排文件||
|docker.conf|定义运行服务的容器名称和使用的镜像版本|注意container_name不要与系统中其他服务的容器重名|
|php.ini|映射到容器中的php.ini配置文件|容器中已经安装的扩展都有单独的配置文件,这里不会有体现|
## 服务端口
在.env文件中可以定义服务端口默认情况下docker容器是在host网络下启动的当然实际使用中也可以改成端口映射模式。
## 已安装PHP扩展
```sh
php -m
[PHP Modules]
Core
ctype
curl
date
dom
event
exif
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
redis
Reflection
session
SimpleXML
sockets
sodium
SPL
sqlite3
standard
tokenizer
xlswriter
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
```