I am trying to run a grails app in docker and keep running in some mysql connection problems. I can't figure out where the problem is.
This is my docker-compose file
version: "2"
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root2017
MYSQL_DATABASE: dbname
MYSQL_USER: Dbuser
MYSQL_PASSWORD: passw
grails:
depends_on:
- db
ports:
- "9001:9001"
restart: always
environment:
DB_HOST: db:3306
DB_PASSWORD: passw
volumes:
db_data:
The grails app does not start with the following error:
ERROR 18:08:05 org.apache.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool. grails_1 | com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure