Open franmadj opened 5 years ago
Where did you run the migrate command? In the container or outside it
From: Francisco Mauri notifications@github.com Sent: Sunday, December 30, 2018 6:07 PM To: neoighodaro/laravel-docker Cc: Subscribed Subject: [neoighodaro/laravel-docker] SQLSTATE[HY000] [2002] php_network_getaddresses when migrate (#4)
when php artisan migrate I get:
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name does not resolve (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations)
using mysql this is my .env:
DB_CONNECTION=mysql DB_HOST=mysql DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret
and this the docker-compose.yml:
version: '3' services: webapp: env_file: .env restart: unless-stopped build: context: ./web args:
Thanks.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/neoighodaro/laravel-docker/issues/4, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAxRlvyA6AnnLWcyxrIxyvrojoG1dqsHks5u-PLXgaJpZM4ZlAUK.
Inside the app container, outside the container there is not DB, I believe containers communicate each other through its default internal network(unless you create a custom one) and uses the service's name as interface instead the localhost or ip.
I have the same problem
Anyone reached a solution for this problem? I'm facing the same Behavior.
when php artisan migrate I get:
using mysql this is my .env:
and this the docker-compose.yml:
Thanks.