Код: Выделить всё
services:
php:
container_name: user-php
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/var/www/html
- ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
ports:
- "80:80"
depends_on:
- mysql
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
XDEBUG_MODE: "develop,debug"
XDEBUG_CONFIG: "client_host=host.docker.internal start_with_request=yes"
mysql:
container_name: user-mysql
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: user_database
MYSQL_USER: my_user
MYSQL_PASSWORD: my_password
ports:
- "3306:3306"
volumes:
- database_data:/var/lib/mysql
volumes:
database_data:
Код: Выделить всё
[critical] Error thrown while running command "make:migration". Message: "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused"
In ExceptionConverter.php line 101:
An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused
In Exception.php line 28:
SQLSTATE[HY000] [2002] Connection refused
In Driver.php line 34:
SQLSTATE[HY000] [2002] Connection refused
Код: Выделить всё
DATABASE_URL="mysql://root:[email protected]:3306/user_database?serverVersion=8.0.39&charset=utf8mb4"
Подробнее здесь: https://stackoverflow.com/questions/790 ... migrations