doz59484 2016-01-28 11:24
浏览 46
已采纳

docker网站在一段时间后打开 - ec2 / virtualbox

I have created a docker image, tested it locally. All working well.

After that I used the same Dockerfile - built it and run it on EC2.

The Apache webserver is listening to the connections, I have opened firewall in EC2 machine security settings, but if I try to navigate to the webisite, it seems to be opening for approx 2.5 minutes.

And then the website OPENS. Each navigation step takes 2.5 minutes.

Later:

I have tried to replicate this environment on Windows machine with Virtual Box and it has exactly same issue. Website would take long time and eventually open. It also broke connect to another machine that that was completely not docker related (Ubuntu dev box)

Can anybody advice something?

Here is docker file:

FROM ubuntu
RUN apt-get update -y
RUN apt-get install -y apache2 php5 vim libapache2-mod-php5 php5-mcrypt 

RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
EXPOSE 80
RUN ln -sf /dev/stderr /var/log/apache2/error.log
CMD /usr/sbin/apache2ctl -D FOREGROUND
  • 写回答

1条回答 默认 最新

  • douyi8732 2016-01-28 14:01
    关注

    As illustrated in "Debug your PHP in Docker with Intellij/PHPStorm and Xdebug", it is possible to debug php from within a container.

    The OP activated it directly in php.ini:

    [xdebug]
      zend_extension="/usr/lib/php5/20121212/xdebug.so" 
      xdebug.remote_enable=on xdebug.remote_handler=dbgg
      xdebug.remote_host=172.17.0.1
      xdebug.remote_port=9000
      xdebug.remote_connect_back=on
      xdebug.remote_autostart=on
      xdebug.remote_log="/var/log/xdebug/xdebug.log" 
    

    Removing that module was enough to bring the response time down.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 数学的三元一次方程求解
  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题