I am having some issues connecting to the mysql docker container that I have launched with docker-compose. This is a long post (sorry!).
Here is my docker-compose.ym
It looks like your problem is solved. I thought I'd discuss my problems similar to this.
I am running tomcat (web) and mysql (db) using docker-compose on a Synology NAS (DSM 6.0.2). It worked fine on an Ubuntu box I have but not on the NAS.
The problem was the firewall on the NAS - I had modified my firewall rules to allow certain ports open but then DENY ALL at end. When I added :3306 to the allowed ports it worked!
This is not a good solution and I don't know why DSM would require this since the docker-compose is running on a BRIDGE network. I've put in a support ticket about this.
This answer may help others with this blocked container issue.