Tag: php

Docker container connect to MySQL database locally -> redirect to another container

I am new to Docker. I have read that it is better to keep an app per container. I need to run web app (LAMP stack). So I have found the container for running PHP + Apache. Now I need to set up a mysql container. But I am not sure what is the correct […]

Docker: php7.0-fpm Executable file not found in $PATH

I am building a Debian 9, NGINX, PHP7 FPM containers. I have this in my php7-fpm docker file (which is based on Debian 9) The problem occurs (I think) when I have this closing line: ENTRYPOINT [“php7.0-fpm”] I have used this before in previous docker build but this one is causing issues with the following […]

How to view php logs information with php docker container?

I have a php-fpm docker container . Php-fpm is run inside container, can i get php-fpm’s log on host machine? If i can, how to do?

Multiple versions of PHP through Nginx in Docker

I run two docker containers for PHP5.6: docker run –name php5 \ -v /html1:/var/www/html/site1 \ -d -p 9001:9000 php:5.6-fpm And for PHP7: docker run –name php7 \ -v /html2:/var/www/html/site2 \ -d -p 9000:9000 php:7-fpm I run Docker container with Nginx: docker run –name nginx-cache \ -v /nginx.conf:/etc/nginx/nginx.conf \ -v /nginx/html1:/var/www/html/site1 \ -v /nginx/html2:/var/www/html/site2 \ -v […]

In docker container connect from inside to local apache not happening

Problem I visit page by browser http://localhost, I see content of public folder. The problem is, when I run tests, curl won’t connect with message: cURL error 7: Failed to connect to localhost port 80: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) (GuzzleHttp\Exception\ConnectException) I run tests by command: docker-compose run –rm php php vendor/bin/behat docker-compose.yml version: ‘2’ services: […]

PDO connection error when running PHINX migration on a Docker Container

I am trying to run a migration using Phinx from my host machine (OSX Sierra) but I keep getting PDO connection error. It’s a simple LAMP stack and is working fine otherwise. Here is my docker-compose: version: ‘2’ services: apache: build: context: ./docker/apache-php7 dockerfile: Dockerfile volumes: – ./app:/var/www ports: – “80:80” – “443:443” networks: – […]

Nginx in Docker container won't run PHP

I’m beginner with Docker, and I’m trying to build my own image: Ubuntu + Nginx + PHP. So, I have a directory called test. Inside directory two other directories, app and sites-enabled. Also, there’s a Dockerfile, with content: FROM ubuntu:trusty RUN apt-get update && \ apt-get install -y nginx php5-fpm php5-mysql php-apc php5-imagick php5-imap php5-mcrypt […]

How to make communicate between nginx and php container

I have PHP web application and i want to convert it into docker. I have these containers mysql php nginx I have source code in my host folder as /var/www/site1 Now when i launch nginx , then i can mount site1 to nginx as /usr/nginx/share/html But i am not sure how does i link with […]

Dockerized PHP Application Architecture Best Practices

I’m pretty new do Docker. I played a lot with Docker in my development environment but I tried to deploy real app only once. I’ve read tons of documentations and watched dozes of videos but still have a lot of questions. I do understand that Docker is just a tool that can be used in […]

How to startup up services on a Docker image?

I’ve created a Dockerfile for a image to run PHP7 on FPM + Nginx, but I can’t get the image to start up the services correctly. How this should be done exactly? Here’s the part where I’m doing it currently: CMD service php7-fpm start; \ service php7-fpm status; \ service nginx start; \ service nginx […]

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