S
S
Sergey Burduzha2021-12-11 19:23:33
Docker
Sergey Burduzha, 2021-12-11 19:23:33

Why is the site running through docker not working?

Created a starter project on laravel 7 version, installed via composer.
Created docker-compose.yaml

version: '3'
services:

  #PHP Service
  app:
    build:
      context: .
      dockerfile: ./docker/php/Dockerfile
    image: php:7.3-fpm
    container_name: webinar_php
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
      - ./docker/php/php.ini:/usr/local/etc/php/conf.d/local.ini

  #Nginx Service
  webserver:
    image: nginx:alpine
    container_name: webinar_nginx
    restart: unless-stopped
    tty: true
    ports:
      - "7777:80"
    volumes:
      - ./:/var/www
      - ./docker/nginx/conf.d/:/etc/nginx/conf.d/

  #MySQL Service
  db:
    image: mysql:5.7.24
    container_name: webinar_mysql
    command: "--default-authentication-plugin=mysql_native_password"
    restart: unless-stopped
    tty: true
    ports:
      - "7776:3306"
    environment:
      MYSQL_DATABASE: laravel
      MYSQL_USER: root
      MYSQL_PASSWORD: root
      MYSQL_ROOT_PASSWORD: root
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    volumes:
      - ./docker/mysql/data:/var/lib/mysql/
      - ./docker/mysql/conf/my.cnf:/etc/mysql/my.cnf

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: webimar_phpmyadmin
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
    ports:
      - 7760:80


Then I performed docker-compose build and after docker-compose up -d

Containers connected, no errors.
I checked the logs of all containers and everything is clean.
docker logs webinar_mysql

Specially posted on github.
https://github.com/seriiserii825/laravel-docker

Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Burduzha, 2021-12-11
@serii81

Solved a problem.
I think the reason was that I had a version of php 8 installed locally on my computer.
And when I installed dependencies through the composer, this version was used.
Therefore, there was a problem

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.3.33. in /var/www/vendor/composer/platform_check.php on line 24

Removed version 8, installed 7.3 and laravel started.
Updated the repository, there is only docker and .env.txt
Perhaps composer is best run in a container?
Although on YouTube, most run on LAN.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question