title: docker-compose rails with mysql
body: <p>Hello i have huge problem.
  I'm trying to run rails and mysql on separate docker containers.
  in docker-compose.yml i have : </p>
  
  <pre><code>version: '2'
  services:
    db:
      image: mysql
      ports:
        - "3307:3306"
      environment:
        MYSQL_ROOT_PASSWORD: zzz
        MYSQL_USER: root
        MYSQL_PASSWORD: zzz
        MYSQL_DATABASE: zzz
    web:
      build: .
      command: bundle exec rails s -p 3000
      volumes:
        - .:/app
      ports:
        - "3000:3000"
      depends_on:
        - db
  </code></pre>
  
  <p>and in my rails database.yml</p>
  
  <pre><code>development:
    adapter: mysql2
    encoding: utf8
    database: zzz
    pool: 5
    username: root
    password: zzz
    host: database.dev //this is host for container with mysql
    port: 3306
  </code></pre>
  
  <p>end when i run application i got error :
  <code>Access denied for user 'root'@'xxx' (using password: YES)</code> where xxx is ip my machine not container. Please help i dont know what to do</p>