Creating specific root user and host name not working
<p>Using wordpress/mariadb docker image I want to install wordpress locally with the following default settings,</p>

<pre><code>DB_NAME: mysite_wp
DB_USER: myuser
DB_PASSWORD: mypw
DB_HOST: localhost
</code></pre>

<p>Using the docker-componse.yml file</p>

<pre><code>version: '2'

services:

  wordpress:
    image: wordpress
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_NAME: mysite_wp
      WORDPRESS_DB_USER: myuser
      WORDPRESS_DB_PASSWORD: mypw
    volumes:
      - ./src:/var/www/html

  mysql:
    image: mariadb
    environment:      
      MYSQL_ROOT_PASSWORD: mypw
      MYSQL_USER: myuser
      MYSQL_PASSWORD: mypw
    volumes:
      - ./db/mysite_wp.sql:/docker-entrypoint-initdb.d/mysite_wp.sql
</code></pre>

<p>I am getting error</p>

<pre><code>wordpress_1  | MySQL Connection Error: (1045) Access denied for user 'myuser'@'172.18.0.3' (using password: YES)
</code></pre>