docker website opens after a while – 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.

  • Deployment on AWS Elastic Beanstalk with Docker fails
  • Dockerfile image path contains invalid charector
  • RabbitMQ Cluster in Docker Container among different hosts
  • AWS EB, Play Framework and Docker: Application Already running
  • User-data script not executed when starting EC2 instance from AWS CLI
  • AWS EC2 Container program command line arguments
  • 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
    

  • What is the simplest way to create an EC2 from a docker image hosted on ECR?
  • Multidocker environment, amazon beanstalk, mounting volumes
  • How do I integrate my git PHP repo into an official Docker Hub container?
  • Graylog2 Docker unable to start
  • Elastic Beanstalk Multicontainer Docker with private repository CannotPullContainerError
  • how to bring an instance from one subnet to the other which is having a docker containers running in that instance?
  • One Solution collect form web for “docker website opens after a while – ec2/virtualbox”

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.