I installed Docker Desktop and created a Laravel project using the following command:
composer create-project laravel/laravel test
I also ran this command:
docker compose up
My docker-compose.yml file contains:
version: "3.9"
services:
mysql:
image: mariadb:10.8.3
# Uncomment below when on Mac M1
# platform: linux/arm64/v8
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
adminer:
image: adminer
restart: always
ports:
- 8080:8080
i also changed a part of .env file to
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel-10-task-list
DB_USERNAME=root
DB_PASSWORD=root
Everything worked, and when I opened the link http://localhost:8080, the SQL login screen appeared. I entered the username and password (root and root), but the following error appeared:
php_network_getaddresses: getaddrinfo failed: Name or service not known
i dont know what should i do.
2