Tag: php

Docker commands via php shell_exec

I’m trying run command from my index.php: $output = shell_exec(‘docker images’); and then output results, or run new container the same way: $output = shell_exec(‘docker run hello-world’); It seems that I could not run ANY docker cmd via php. How do it properly?

Isolate PHP applications with Docker

I am trying to setup set of docker containers to serve couple of applications. One of my goals is to isolate PHP applications from eachother. I am new to Docker and not fully understand its concepts. So only idea i came up with is to create a dedicated php-fpm container per-application. I started with official […]

PHP 7 install on Ubuntu 14.04 now fails due to libssl dependency that cant be resolved?

I am using shippable to build my project and part of it requires PHP. The build script is this: apt-get update apt-get install -y software-properties-common python-software-properties language-pack-en-base LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php apt-get update apt-get install -y php7.0 php7.0-bcmath Today the build failed while installing PHP with the following error: apt-get install -y php7.0 php7.0-bcmath Reading package […]

PHP Development Environment using Docker

I’m currently trying to setup a PHP development environment using NGINX and PHP-FPM Docker containers. Now I know that this can be accomplished either as a single container running both services, or even as a multiple container setup where each service runs in its own container (that’s based on my research so far). My problem […]

Run a database migration command when deploying a Docker container to AWS

Please bear with me. Pretty new to Docker. I’m deploying Docker containers (detached) to an AWS EC2 registry using CodeDeploy. On deploy, the following command is run after setting some environmental variables etc: exec docker run -d ${PORTS} -v cache-${CACHE_VOLUME} –env-file $(dirname $0)/docker.env –tty “${IMAGE}:${TAG}” The container runs an image located and tagged in EC2 […]

How to run docker-compose with php-fpm and php-cli?

I need to run docker-compose with two containers,- php-fpm and php-cli. Although I need another container with composer. Here is my docker-compose.yml file: version: ‘2’ services: nginx: container_name: travellizy_nginx build: ./docker/nginx restart: always #ports: # – “8080:80” volumes: – ./api:/api – ./docker/nginx/nginx.conf:/etc/nginx/conf.d/site.conf – ./docker/nginx/log:/var/log/nginx links: – php – mysql networks: travelnet: ipv4_address: 172.27.0.101 php: container_name: […]

Specify umask in Dockerfile

I’m using Mac OS and recently I’m trying to set up a development environment with docker. Docker seems to be nice, but currently I’m facing the following problem: PROBLEM: Whenever PHP (in the docker container) is creating a folder with a subfolder, apache results in a 500-error. Apache-log: “… Can’t create directory app/../../folder/subfolder/subsubfolder/” I assume […]

Nginx Net::ERR_INCOMPLETE_CHUNKED_ENCODING when trying to show large JSON

Hello I am trying to show large json using php but when JSON file is large I get Net::ERR_INCOMPLETE_CHUNKED_ENCODING and see “/var/lib/nginx/fastcgi/1/00/0000000001″ failed (13: Permission denied) while reading upstream in my nginx log. My nginx server starts as from www-data user. ps aux | grep nginx root 1 0.0 0.0 95592 8872 ? Ss 12:08 […]

nginx docker instance multiple application

So, I am Dockerizing my architecture which consists of multiple php applications ran on apache. If I’m right I need: 1 nginx container, 1 php container and multiple data-containers to volume-from in the nginx container. How would I be able to have multiple data container linked to my nginx container? So for example I got […]

Dockerfile vs docker-compose.yml

What’s the relation between Dockerfile and docker-compose.yml files? Looks like I can build any Linux setup using Dockerfile using FROM, RUN (apt-get etc. and CMD commands. But it seems, this is not much reusable (I can reuse the whole image, but the services are hardcdoded and not reusable by other projects). Shall I use both […]

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