Trying to connect to mysql host DB from within a docker container

Hello,

I’m trying to run a docker container via this file (docker-compose.yml):

services:
  metabasehks:
    image: metabase/metabase
    container_name: dwh_metabase
    restart: always
    environment:
      MB_DB_TYPE: mysql
      MB_DB_DBNAME: dwhapp
      MB_DB_PORT: 3306
      MB_DB_USER: dwhapp
      MB_DB_PASS: *******
      MB_DB_HOST: HOST_IP
    volumes:
      - metabasedwh_data:/dwh-metabase-data
    ports:
      - 37259:3000
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  metabasedwh_data:

I’ve tried several options for HOST_IP (localhost, the public server IP, the hostname) but so far, nothing worked.
The mysql server is configured so that it’s possible to access it from remote.

The error is always after docker-compose up:

ERROR metabase.core :: Metabase Initialization FAILED
dwh_metabase | clojure.lang.ExceptionInfo: Unable to connect to Metabase mysql DB. {}

I’m not sure, but I somehow assume, the issue is with my container setup.
Anybody knows a solution?

Solution was easy, once found:

MB_DB_HOST: host.docker.internal