SQLSTATE[HY000] [1045] Access denied for user 'nextcloud'@'172.19.0.5' (using password: YES)

Hi all,

I have been trying to install nextcloud on Terramaster. I have been having so many issues but now I think I am down to my final issue. For some reason, I am struggling to create the admin account. Would someone pleas ebe able to help me? As I am absolutely clueless on what I have missed.

Below is my docker-compose.yml file:

    version: '3.3'

    volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=test
      - MYSQL_PASSWORD=test
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=test
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
    depends_on:
      - proxy
      - db
  
  proxy:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      # Public HTTP Port:
      - '84:84'
      # Public HTTPS Port:
      - '1000:1000'
      # Admin Web Port:
      - '81:81'
    environment:
      # These are the settings to access your db
      DB_MYSQL_HOST: "db1"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "test"
      DB_MYSQL_NAME: "npm"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
      - ./config.json:/app/config/production.json
    depends_on:
      - db1

  db1:
    image: mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'dbrootpwd1'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'test'
    volumes:
      - ./data/mysql:/var/lib/mysql