Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

docker开发tp5应用,访问速度很慢

docker环境:

centos8
bt面板
nginx
php7.0
mysql5.6 

最开始怀疑是mysql在docker环境运行很慢,切换到远程数据库问题依旧存在。平均每页面响应时间为5-10s

代码挂载在宿主机目录。bt面板及ls该目录速度一切正常。测试过lavarel框架,访问也很慢

dockerfile附上

FROM centos:latest AS build
LABEL author="ncluoyu"

RUN rm -f /etc/init.d 
    && mkdir -p /www/init.d 
    && ln -s /www/init.d /etc/init.d 
    && chmod +x /start.sh 
    && mkdir -p /www/wwwroot 
    && cd /home 
    && yum -y update 
    && yum install -y wget 
    && wget -O install.sh http://download.bt.cn/install/install_6.0.sh 
    && echo y | sh install.sh 
    && yum clean all

RUN bash /www/server/panel/install/install_soft.sh 0 install nginx 1.17
RUN bash /www/server/panel/install/install_soft.sh 0 install php 7.1 || echo 'Ignore Error'
RUN bash /www/server/panel/install/install_soft.sh 0 install mysql 5.6
WORKDIR /www/wwwroot

EXPOSE 8888 80

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...