0

After working on docker-compose file and after run command (On Windows 10)

docker-compose up -d

i got he next error once i visiting

http://localhost:8088/

The Result

my docker compose file is

version: "3"

networks:
  laravel:

services:
  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    ports:
      - "8088:80"
    volumes:
      - ./src:/var/www/html
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php
      - mysql
    networks:
      - laravel
  mysql:
    image: mysql:5.7.22
    container_name: mysql
    restart: unless-stopped
    tty: true
    ports:
      - "4306:3306"
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_DATABASE: homestead
      MYSQL_USER: homestead
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: password
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
      - laravel
  php:
    build:
      context: .
      dockerfile: DockerFile
    volumes:
      - ./src:/var/www/html
    ports:
      - "9000:9000"
    networks:
      - laravel

DockerFile is

FROM php:7.2-fpm-alpine

RUN docker-php-ext-install pdo pdo_mysql

nginx/default.conf is (which is i think the problem in because when i empty it i got not found page)

 server{
     listen 80;
     index index.php index.html;
     server_name: localhost;
     error_log /var/log/nginx/error.log;
     access_log /var/log/nginx/access.log;
     root /var/www/public;
 
     location / {
         try_files $uri $uri/ /index.php?$query_string;
     }
 
     location ~ \.php$ {
         try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass php:9000;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_param PATH_INFO $fascgi_path_info;
    } }

after empty this file

server{
    # listen 80;
    # index index.php index.html;
    # server_name: localhost;
    # error_log /var/log/nginx/error.log;
    # access_log /var/log/nginx/access.log;
    # root /var/www/public;

    # location / {
    #     try_files $uri $uri/ /index.php?$query_string;
    # }

    # location ~ \.php$ {
    #     try_files $uri =404;
    #     fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #     fastcgi_pass php:9000;
    #     fastcgi_index index.php;
    #     include fastcgi_params;
    #     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #     fastcgi_param PATH_INFO $fascgi_path_info;
    # }
}

and rebuild and up the composer i got next screen enter image description here

2
  • carefully check your container logs. since you told nginx to log to files you'll also need to check those.
    – erik258
    Jul 24, 2020 at 21:23
  • where is the location of those file in windows 10
    – Roufail
    Jul 24, 2020 at 21:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.