Tag: php

Issues connecting a Symfony2 app to a database container in Docker

I’ve got a Symfony2 application in a docker project, using docker-compose. I get the following error when trying to run schema updates to my database. [Doctrine\DBAL\Exception\DriverException] An exception occured in driver: SQLSTATE[HY000] [1130] Host ‘172.17.0.129’ is not allowed to connect to this MySQL server My docker-compose.yml file: api: build: images/nginx ports: – “80:80” – “9000:9000” […]

how get env variables from docker in symfony yml config file

in docker-compose.yml: mysql: image: mysql:latest container_name: mysql environment: – MYSQL_ROOT_PASSWORD=root – MYSQL_DATABASE=symfony – MYSQL_USER=symfony – MYSQL_PASSWORD=symfony how i can get this variables in yml config file: parameters: database_host: 172.17.42.4 database_port: 3306 database_name: symfony database_user: symfony database_password: symfony in $_SERVER they are fetch like: $_SERVER[“SYMFONY_MYSQL_ENV_MYSQL_DATABASE”], $_SERVER[“SYMFONY_MYSQL_PORT_3306_TCP_ADDR”], $_SERVER[“SYMFONY_MYSQL_ENV_MYSQL_PASSWORD”], $_SERVER[“SYMFONY_MYSQL_ENV_MYSQL_USER”]

Dockerize laravel queue:listen

I have docker image that should run laravel queue. In the image i have command php artisan queue:listen but when i start the container nothing happens and the container runs. Here is the base image FROM php:5.6-apache COPY ./000-default.conf /etc/apache2/sites-available/000-default.conf RUN ln -s /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf RUN curl -sS https://getcomposer.org/installer | php — –install-dir=/usr/local/bin –filename=composer RUN […]

Docker Network inside a container partially working

I have running the “FROM php:5.6-apache” container with my own php application. That works. But one part didn’t. My application can not use the network. If i run manualy docker run -t -i myapp ping 8.8.8.8 it that works great. But if my app does it like $ping = exec(“ping -c 1 -s 64 -t […]

Craft CMS With Php/Nginx on Docker can't write outside Document Root

I’m trying to set up a containerized version of a basic Craft CMS set up using Docker with Php and Nginx. Craft can’t seem to write to folders outside of my Nginx Document Root. (See bottom of post for more details) I’m using Docker-Compose and this is my current Docker-compose.yml: nginx: build: ./compose/nginx/ ports: – […]

Docker gd module for PHP 7

I’ve got docker file, which is configured for Drupal 8, but after I fired up “docker-compose up”, everything went smooth but in installation of Drupal it’s showing me that “gd” module for PHP is not enabled. here is my Dockerfile: FROM php:7-fpm # Install modules RUN apt-get update RUN apt-get install -y software-properties-common RUN DEBIAN_FRONTEND=”noninteractive” […]

Docker + Nginx deleted folder issue

I have been trying to setup this docker image: https://github.com/Muraad/joomla-docker In practice it has worked great. Docker builds the image, I can run it in a container, and I can link Joomla with another Docker container running mysql. Joomla is hosted by Nginx and PHP5-FPM. The problem starts when I delete the installation folder. While […]

Docker limit the size of a volume

I make a simple Apache/PHP5 docker environment who use tutum/apache–php. My docker-compose.yml dile : web: build: apache ports: – “80:80” volumes: – /var/www/html/erp:/var/www – /var/www/html/erp/conf/php/php.ini:/etc/php5/apache2/conf.d/30-custom.ini – /var/www/html/erp/conf/apache/sites-enabled:/etc/apache2/sites-enabled My Apache Dockerfile : FROM tutum/apache-php RUN apt-get update && apt-get -yq install php5-mcrypt && apt-get -yq install php5-mcrypt RUN a2enmod ssl RUN /etc/init.d/apache2 restart EXPOSE 80 CMD […]

Not able to see STDERR Output with docker

I’m running a php docker image (php:5.6-apache) which has apache’s error and access logs redirected to STDERR and STDOUT respectively using symbolic links. When I run the docker image in the foreground or access the docker container logs, I can see the STDOUT output. But I don’t see any errors (even when I generate php […]

Docker, varnish, Connection reset by peer

I’m just trying to set up a web server using Docker. I have 3 different containers: jprjr/php-fpm sudo docker run –name c_php-fpm -v $HOME/data/webstack/www:/srv/http:ro -p 9000:9000 -d jprjr/php-fpm nginx sudo docker run –name c_nginx -v $HOME/data/webstack/www:/usr/share/nginx/html:ro -p 8080:80 –link c_php-fpm:c_php-fpm -d nginx nginx jacksoncage/varnish sudo docker run –name c_varnish -i -d -p 80:80 –link c_nginx:c_nginx […]

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