version: '2'

services:
  api:
    build: ./
    restart: always
    environment:
      MYSQL_URL: mysql://root:root@mysql:3306/ganjoor
      BYPASS_AUTH: yes
    ports:
      - "4003:4003"
    links:
      - db:mysql
    depends_on:
      - db

  db:
    image: ganjoor/ganjoor-db
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: ganjoor

version: '2'

services:
  api:
    build: ./
    restart: always
    environment:
      MYSQL_URL: mysql://root:root@mysql:3306/ganjoor
      BYPASS_AUTH: "yes"
    ports:
      - "4003:4003"
    links:
      - db:mysql
    depends_on:
      - db

  db:
    image: ganjoor/ganjoor-db
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: ganjoor

Update environment bug in Docker Composer
Update environment bug in Docker Composer