//启动项目
nohup php bin/hyperf.php server:watch > /dev/hyperferror.log 2>&1 &
//composer加载更新
composer dump-autoload
//这是docker镜像的启动脚本,附件是hyperf8.1的镜像
docker run --name phpreal -v /home/php_code/lgb-hf:/hyperf-skeleton -p 9501:9501 -it --privileged -u root -d --entrypoint /bin/sh hyperf/hyperf:8.1-alpine-v3.17-swoole
docekr run -v /etc/localtime:/etc/localtime
//启动时设置时间
docker run --name phpreal -v /home/php_code/lgb-hf:/hyperf-skeleton -v /etc/localtime:/etc/localtime -p 9501:9501 -it --privileged -u root -d --entrypoint /bin/sh hyperf/hyperf:8.1-alpine-v3.17-swoole
//关于时间
docker cp /etc/localtime phpreal:/etc/localtime
测试机:
docker cp /usr/share/zoneinfo/Asia/Shanghai phpreal:/etc/localtime
windows下docker中时间设置
apk update //可以不运行
apk add tzdata
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date_default_timezone_set('Asia/Shanghai');
网友评论