I need an example of setting up MySQL and phpmyadmin on a docker compose file.
Question posted in PhpMyAdmin
The official documentation can be found here.
The official documentation can be found here.
I need an example of setting up MySQL and phpmyadmin on a docker compose file.
2
Answers
Added mysqlclient dependency into requirements.txt. required to allow Django to connect with MySQL.
In the Dockerfile, added the following into the Dockerfile:
Dockerfile
Set up MYSQL configurations on django
settings.py
:settings.py
I added the following in the **docker-compose** file:
docker-compose.yml
On the port :8082 (http://0.0.0.0:8082/) you will find phpmyadmin:
phpMyAdmin Dashboard
you have to setup username and password under environment in docker-compose.yml file.
and for phpmyadmin, I had used a phpmyadmin image from docker hub: