I have a'docker-compose.yml' file where I have: MYSQL and php separated in containers.
I enter the container with php, to execute the command'php artisan migrate', in the first instance it tells me that the pdo_mysql driver is missing, that I could solve it, the error that I could not solve is the one that says' SQLSTATE [HY000] [2002] Connection refused '
I leave my'.yml' here to see if I'm missing something or I'm failing something.
version: '2'
services:
composer:
container_name: wallet-project-composer
image: composer
volumes:
- .:/app
database:
container_name: wallet-project-database
image: mysql:5.6
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_DATABASE: project
MYSQL_ROOT_PASSWORD: password
rest:
container_name: wallet-project-rest
image: php:7.2
working_dir: /app
command: php -S 0.0.0.0:8000 ./api/public/index.php
ports:
- 8000:8000
volumes:
- .:/app
phpmyadmin:
container_name: wallet-project-phpmyadmin
depends_on:
- database
image: phpmyadmin/phpmyadmin
ports:
- 8001:80
environment:
PMA_HOST: database
MYSQL_ROOT_PASSWORD: password
volumes:
db_data:
Everything works wonderfully, the only problem is that.