-1
I’m trying to develop an Laravel application with Docker
My Docker-Compose.yml file looks like this:
version: "3.3"
services:
mysql:
image: mysql:8.0.1
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: "123"
ports:
- '3307:3306'
volumes:
- mysql-db:/var/lib/mysql
networks:
- code-network
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
ports:
- 8080:80
links:
- mysql:db
networks:
- code-network
php7.3:
image: quay.io/vesica/php73:latest
container_name: php73
volumes:
- ./var/www/html:/var/www/html
- ./etc/apache2/sites-available:/etc/apache2/sites-available
ports:
- 80:8080
networks:
- code-network
volumes:
mysql-db:
networks:
code-network:
driver: bridge
The file configuration . env is like this:
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3307
DB_DATABASE=meubanco
DB_USERNAME=root
DB_PASSWORD=123
But when I try to access my application I have the following message:
Illuminate Database Queryexception (2002) SQLSTATE[HY000] [2002] Connection refused (SQL: select * from
users
Whereenable
= S)
What is still missing?
And what would be the
db
inmysql:db
?– Woss