Tag: php

Installing osixia/docker-openldap using docker-compose

I do know why this won’t work with docker-compose, even after I use osixia/openldap:1.0.2. here is my docker-compose.yml : … openldap: image: osixia/openldap:1.0.2 ports: – “389:389″ environment: – LDAP_ORGANISATION=myorg – LDAP_DOMAIN=myorg.com.au – LDAP_ADMIN_PASSWORD=password the problem is it keep stuck/stop at “Pulling repository docker.io/osixia/openldap” for about 1 hour, here is the detail : Pulling openldap (osixia/openldap:1.0.2)… […]

Docker LAMP Stack

I’m just learning Docker and I’ve managed to get a few containers going, but I’m trying to learn how to run everything on separate containers. SO, the idea is that I have: Mysql Container (working) PHP-FPM Container (partially working) Apache Container (not working yet) I’ve setup my LAMP stack on a vagrant and tested it […]

Docker data-only container permissions

I’m developing PHP app and I’m stuck with Docker volumes. I’ve tried to create a separate data-only container for my PHP app but couldn’t make it work because of permission issues… I’ve googled and read all I could and the most close to working solution is described here But it’s a bit old and I […]

owncloud cron execution within docker

Im using php-apache image to create an owncloud installation. I want to use a system cronjob to execute cron.php, therefore I run: RUN echo “*/3 * * * * php -f /var/www/html/cron.php >> /oc_data/cron.log” > /cron.conf \ && crontab -u www-data /cron.conf The entrypoint script starts cron with: cron -f It gets executed but the […]

Get 502 Bad Gateway when use fastcgi_pass: 127.0.0.1:9000

I have next docker-compose file: nginx: build: . ports: – “80:80” – “443:443” links: – fpm fpm: image: php:fpm ports: – “9000:9000” The Dockerfile command list is: FROM nginx ADD ./index.php /usr/share/nginx/html/ # Change Nginx config here… RUN rm /etc/nginx/conf.d/default.conf ADD ./default.conf /etc/nginx/conf.d/ And my custom Nginx config default.conf file is: server { listen 80; […]

Phalcon doesnt work properly on nginx

Today I have a problem with Phalcon (2.0.7). Main environment is running Centos 7 which runs docker with Debian’s latest image. On Docker I have installed PHP 5.4.45 and Nginx 1.2.1 There is config file (/etc/nginx/nginx.conf) user www-data www-data; ## Default: nobody worker_processes 5; ## Default: 1 error_log logs/error.log; #pid logs/nginx.pid; worker_rlimit_nofile 8192; events { […]

PHP-Apache in Docker with only one request in the same time

This is my Dockerfile for dev enviroment: FROM php:5.6-apache RUN apt-get update \ && apt-get upgrade -y \ && apt-get install -y -o Dpkg::Options::=”–force-confold” \ libapache2-mod-php5 \ php5-mysql \ php5-cgi \ php5-curl \ php5-sqlite \ php5-gd \ wget \ gdebi \ php5-xdebug \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN a2enmod rewrite RUN […]

php:5.6-apache Docker gives empty response on macos

I’ve installed Docker Tools on macos and now I’m trying to run the container. Done so far: install docker tools and run docker create Dockerfile: FROM php:5.6-apache COPY . /var/www/html/ Create container (as described at https://hub.docker.com/r/library/php/): $ docker build -t myapp . The current directory has one index.html with very simple content. Run the container: […]

Docker (NGINX, PHP, mySQL) and Windows – File Permissions

I’ve been looking into docker for a few hours; I’m running Windows 8.1 as the host machine, and VirtualBox with boot2docker. This is my docker-compose.yml: mysql: image: mysql ports: – “6603:3306” environment: MYSQL_ROOT_PASSWORD: mysql MYSQL_USER: mysql fpm: image: php:7.0.2-fpm volumes: – /c/Users/Administrator/www:/var/www/html ports: – “9000:9000” links: – mysql nginx: image: nginx ports: – “80:80” – […]

Docker environment variables in php

How do I use the variables defined in Docker for use in PHP? Example in Docker: $ docker run -d my_container -e MYSQL_CONNECT=”{host:’x’, port:’x’}” Example in PHP: $_ENV[‘MYSQL_CONNECT’] I’ve searched, but could not find anything concrete.

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