I have started a docker container with the following command
docker run --name mysql --restart always -p 3306:3306 -v /var/lib/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7.14
and then would like to connect a wordpress site with the following docker-compose.yml file
version: '2'
services:
wordpress:
image: wordpress
external_links:
- mysql:mysql
ports:
- 80:80
environment:
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: password
volumes:
- /var/www/somesite.com:/var/www/html
But I keep getting the following error
Starting somesitecom_wordpress_1
Attaching to somesitecom_wordpress_1
wordpress_1 |
wordpress_1 | Warning: mysqli::mysqli(): (HY000/2002): Connection refused in - on line 19
wordpress_1 |
wordpress_1 | MySQL Connection Error: (2002) Connection refused
It seems like the external_links
isn't working.
Any idea what I am doing wrong?