Summary: Wordpress running from local Docker connecting to Azure SQL.
- I am following a guide: link
- I have built Ubuntu in Azure and installed Docker CE
- I cloned a GitHUb WordPress image (based on the guide)
- I built the image ‘Docker Build’
- I then ran the image and used the command suggested in the guide.
sudo docker run --name test1 -e DB_ENV_HOST=M.mysql.database.azure.com:3306 -e DB_ENV_USER=@sql4cicdtest -e DB_ENV_PASSWORD= -e DB_ENV_NAME=wordpressprod -p 80:80 -d
- the image runs fine ‘Sudo Docker PS’
- The image successfully loads in a container on the local Ubuntu server
- I can navigate to the website: http://sh-vm-docker.uksouth.cloudapp.azure.com/ (its live now if anyone wanted to check)
- It says " Error establishing a database connection"
I am able to verify that the Azure SQL database engine is listening by using a PowerShell command: Test-NetConnection .mysql.database.azure.com -port 3306
I suspect the string which sets the environment variables for WordPress is incorrect. I am VERY new to Docker and I am not a developer. Sorry for the basic / mistplaced nature of the question. I wasnt sure where was best to post a) on the site where the guide was written, b) on WordPress forums, c) on Azure forums or d) on here.
So this might be be so relevant, appologies in advance.
Steps to reproduce the behavior