A docker-compose with PHP 8 & MySQL 5.7, ready to go
- Ensure you have docker & docker-compose install in your machine.
- Clone the repo
git clone https://github.com/samuel27m/php8-mysql-docker.git
- Go to 'php8-mysql-docker' folder.
- Run
docker-compose up -d
- Go into the PHP container
docker-compose exec app bash
- Go into the MySQL container
docker-compose exec db bash
USERNAME = user
PASSWORD = secret
DATABASE = db
PORT = 3306
HOST = db (if you're connecting from a container)
HOST = localhost (if you're connecting from your machine)
- Linux
- Windows (With Docker Desktop and WSL2 integration)