Simple docker compose file built as an exercise and also in order to be able to follow Complete SQL Mastery available at codewithmosh.com. First three hours of the course are available on Youtube as MySQL Tutorial for Beginners. Tested with docker version 24.0.2 and docker compose 2.18.1.
Sets up a mysql container and a php-admin container in a new docker network. First time template is run, persistent volumes for both container will be created. Mysql container may take a bit longer to become available the first time. This is a very simple template lacking any security or scalability.
Deploy:
docker compose up
Tear down:
docker compose down
Default user and password:
user: root
password: 123
Connect to php-admin using a browser:
http://0.0.0.0:82
Alternatively, a db client such as Antares may be used:
Access mysql container:
docker exec -ti mysql /bin/bash
If you ever want to start from scratch, delete mysql volume:
docker volume rm mysql-volume