I am trying to set my PHP application with Docker. It builds successfully but when I hit in browser - its showing 0.0.0.0 didn’t send any data.
Here is my docker-compose.yml
::
version: '2'
services:
# The Application
app:
build:
context: ./
dockerfile: app.dockerfile
working_dir: /Users/sr/Sites/zogo-commerce/public
volumes:
- ./:/var/www/zogo-commerce/public
environment:
- "DB_PORT=3306"
- "DB_HOST=127.0.0.1"
# The Web Server
web:
build:
context: ./
dockerfile: web.dockerfile
working_dir: /Users/sr/Sites/zogo-commerce/public
volumes_from:
- app
ports:
- 9090:80
# The Database
database:
image: mysql:5.6
volumes:
- dbdata:/usr/local/bin/mysql
environment:
- "MYSQL_DATABASE=zogo_commerce"
- "MYSQL_USER=root"
- "MYSQL_PASSWORD=root1234"
- "MYSQL_ROOT_PASSWORD=root1234"
ports:
- "33061:3306"
volumes:
dbdata:
File web.dockerfile
::
FROM nginx:1.10
ADD vhost.conf /etc/nginx/conf.d/default.conf
File app.dockerfile
::
FROM php:7.0.4-fpm
RUN apt-get update && apt-get install -y libmcrypt-dev \
mysql-client libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install mcrypt pdo_mysql
Virtual host file vhost.conf
::
server {
listen 8080;
server_name zogo-commerce.local;
root /var/www/zogo-commerce/public;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 600;
}
}
Here is my containers :
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS
NAMES
11d6a74becfe zogo-commerce_web "nginx -g 'daemon of…" 5
minutes ago Up 5 minutes 443/tcp,
0.0.0.0:9090->80/tcp zogo-commerce_web_1
032249f95de8 zogo-commerce_app "php-fpm" 5
minutes ago Up 6 minutes 9000/tcp
zogo-commerce_app_1
9515f4708708 mysql:5.6 "docker-entrypoint.s…" 18
minutes ago Up 6 minutes 0.0.0.0:33061-
>3306/tcp zogo-commerce_database_1
It seems build is okay but in brwser http://0.0.0.0:9090/
showing ERROR.
How do I resolve this issue to make it workable ? thanks in advance::
Here is my Files:
docker-compose.yml: https://pastebin.com/bZUHMRvr
app.dockerfile: https://pastebin.com/bUKZ2suj
web.dockerfile: https://pastebin.com/0qbCGnWm
vhost.conf: https://pastebin.com/MnZkbTe2
docker-compose up :: Error -> https://pastebin.com/6HEgpJk1