title: Docker dpage/pgadmin4 error: specified user does not exist
body: <p>This is the <code>docker-compose.yml</code> file:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>version: '3'
  
  services:
  ############################
  # Setup database container #
  ############################
    postgres_db:
      image: postgres
      restart: always
      ports:
        - ${POSTGRES_PORT}:${POSTGRES_PORT}
      environment: 
        - POSTGRES_USER=${POSTGRES_USER}
        - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
        - PGDATA=/var/lib/postgresql/data/pgdata
        - POSTGRES_DB=${POSTGRES_DB}
      volumes:
        - ./data:/var/lib/postgresql/data 
      networks:
        - db_network
  
    pgadmin:
      image: dpage/pgadmin4:4.19
      restart: always
      ports:
        - 8001:8080/tcp
      environment: 
        - PGADMIN_LISTEN_ADDRESS=0.0.0.0
        - PGADMIN_LISTEN_PORT=8080
        - PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
        - PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
      networks:
        - db_network
  
  networks: 
    db_network:
      driver: bridge
  
  </code></pre>
  
  <p>There is a <code>.env</code> file in the same directory.</p>
  
  <pre><code># The above refers to the name of the postgres container since using docker-compose
  # This is because docker-compose creates a user-defined network. Kubernetes also does this.
  POSTGRES_PORT=5432
  POSTGRES_USER=website
  POSTGRES_PASSWORD=website
  POSTGRES_DB=wikifakes_main
  PGADMIN_DEFAULT_EMAIL=info@my-website.com
  PGADMIN_DEFAULT_PASSWORD=my-secure-password 
  </code></pre>
  
  <p>When executing <code>docker-compose up --build</code> both docker start and I can access the pgAdmin4 website via <code>localhost:8001</code>.
  However, after entering the credentials, I get the following response:</p>
  
  <blockquote>
    <p><strong>Specified user does not exist</strong></p>
  </blockquote>
  
  <p>Why does the specified user not exist and how should I change my environment so that I can log in?</p>
  
  <p>The login on an <code>pgadmin4</code> docker created via <code>docker run --rm -e PGADMIN_DEFAULT_EMAIL="info@my-website.com" -e PGADMIN_DEFAULT_PASSWORD="my-secure-password" -p 8001:80 dpage/pgadmin4</code> works alright though.</p>