can't run php site using docker on prouduction host

I only have this issue on a Digital Ocean box. On my laptop I can see the website. On production I get 500 when trying to curl my site.
if i hit the gateway of that docker from the outside world, i can see my site. but that’s not a solution. i would like to point my dns to the ip of the host and not the docker gateway.


  • How to add private registry certs to Docker Machine
  • Docker stuck on “Waiting for SSH to be available…”
  • Problems in Jenkins Guided tour on Mac
  • Authenticate with Docker registry API
  • Tomee and Postgres communication with Docker
  • Docker unable to connect AWS EC2 cloud
  • FROM phusion/baseimage:0.9.15
    ENV HOME /root
    RUN /etc/my_init.d/
    CMD ["/sbin/my_init"]
    # Nginx-PHP Installation
    RUN apt-get update
    RUN apt-get install -y vim curl wget build-essential python-software-properties
    RUN add-apt-repository -y ppa:ondrej/php5
    RUN add-apt-repository -y ppa:nginx/stable
    RUN apt-get update
    RUN apt-get install -y --force-yes php5-cli php5-fpm php5-mysql php5-pgsql php5-sqlite php5-curl\
                           php5-gd php5-mcrypt php5-intl php5-imap php5-tidy
    RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/fpm/php.ini
    RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/cli/php.ini
    RUN apt-get install -y nginx
    RUN echo "daemon off;" >> /etc/nginx/nginx.conf
    RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf
    RUN sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php5/fpm/php.ini
    RUN mkdir -p        /var/www
    ADD build/default   /etc/nginx/sites-available/default
    RUN mkdir           /etc/service/nginx
    ADD build/  /etc/service/nginx/run
    RUN chmod +x        /etc/service/nginx/run
    RUN mkdir           /etc/service/phpfpm
    ADD build/ /etc/service/phpfpm/run
    RUN chmod +x        /etc/service/phpfpm/run
    EXPOSE 80
    # End Nginx-PHP
    RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

    build and run

    docker build -t donate-home .
    docker run --name donate-home -d -p 3001:80 -v $(pwd)/www:/var/www:rw donate-home /sbin/my_init --enable-insecure-key

    on production host

    curl -i localhost:3001

    HTTP/1.1 500 Internal Server Error

    docker logs donate-home

    *** Installing insecure SSH key for user root                                                                                                                                          │····························
    Creating directory /root/.ssh...                                                                                                                                                       │····························
    Editing /root/.ssh/authorized_keys...                                                                                                                                                  │····························
    Success: insecure key has been added to /root/.ssh/authorized_keys                                                                                                                     │····························
    +------------------------------------------------------------------------------+                                                                                                       │····························
    | Insecure SSH key installed                                                   |                                                                                                       │····························
    |                                                                              |                                                                                                       │····························
    | DO NOT expose port 22 on the Internet unless you know what you are doing!    |                                                                                                       │····························
    |                                                                              |                                                                                                       │····························
    | Use the private key below to connect with user root                         |                                                                                                        │····························
    +------------------------------------------------------------------------------+                                                                                                       │····························
    -----BEGIN RSA PRIVATE KEY-----                                                                                                                                                        │····························
    <content of private key>
    -----END RSA PRIVATE KEY-----                                                                                                                                                          │····························
    *** Running /etc/my_init.d/                                                                                                                                │····························
    *** Running /etc/rc.local...                                                                                                                                                           │····························
    *** Booting runit daemon...                                                                                                                                                            │····························
    *** Runit started as PID 17                                                                                                                                                            │····························
    [13-Feb-2015 22:13:12] NOTICE: fpm is running, pid 31                                                                                                                                  │····························
    [13-Feb-2015 22:13:12] NOTICE: ready to handle connections

  • Concourse pending for long time before running task
  • Docker with GUI application
  • Can't connect pgbouncer and postgres running with docker
  • error: unexpected end of file (expecting “do”) for shell script in Dockerfile
  • docker-compose volumes_from equivalent with version 3
  • Failed load docker hdp hortonwork
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.