title: Docker compose file not working for Sequlize and Mysql in Node app
body: <p>I have a Node js app build with express and sequelize .My database is Mysql.
  I am using docker for make container from this app.I just used docker compose for Node and Mysql.</p>
  <p>Here is my database config file for sequlize</p>
  <pre><code>const Sequelize = require('sequelize');
  
  const sequelize = new Sequelize('sample_db', 'root', '123456', {
      host: 'mysql',
      dialect: 'mysql',
    })
  
  
    sequelize.authenticate()
      .then(() =&gt; {
        console.log('DB connected');
      })
      .catch(err =&gt; {
        console.error('Unable to connect to the database:', err);
      });
  
  
  var db = {};
  
  db.sequelize = sequelize;
  db.Sequelize = Sequelize;
  
  module.exports = db;
  </code></pre>
  <p>Here is my docker compose file</p>
  <pre><code>version: &quot;3&quot;
  services:
    app: 
      container_name: my_app
      build: .
      ports: 
          - 5000:3000
      depends_on:
          - mysql
      expose:
          - &quot;5000&quot;
    mysql:
      image: mysql
      restart: always
      environment:
          - MYSQL_PASSWORD=1234
          - MYSQL_ROOT_PASSWORD=123456
          - MYSQL_DB=sample_db
      ports:
          - &quot;3307:3306&quot;
  </code></pre>
  <p>But sequelize is not connected properly and gives the following error</p>
  <pre><code>SequelizeConnectionRefusedError: connect ECONNREFUSED 172.20.0.2:3306  at ConnectionManager.connect (/app/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:116:17)
  </code></pre>
  <p>Cant fix it. Is there a better way?</p>