How to enter password for postgres via docker?

Hello! Help to understand please.
Run django and postgresql docker-compose.
The contents of the docker-compose.yml:
version: '3'

services:
web:
 build: ./t_kontakta
 command: python3 manage.py runserver 0.0.0.0:8000
volumes:
 - ./t_kontakta:/data
ports:
 - "8000:8000"
depends_on:
 - db
db:
 image: postgres
 restart: always
environment:
 - POSTGRES_PASSWORD=password
 - POSTGRES_DB=postgres


On the Mac import database postgres with the following command:
docker-compose run --rm db pg_dump -h db-U postgres postgres > database.sql

In response to asking for a password, and successfully unloaded all data to a file.
On another device(on Windows) is now trying to load the data in the database with the command:
docker-compose run --rm db psql -h db-U postgres postgres < database.sql

In response swearing:

Password for user postgres:
psql: error: could not connect to server: FATAL: password authentication failed for user "postgres"
April 19th 20 at 12:02
1 answer
April 19th 20 at 12:04
https://www.postgresql.org/docs/11/libpq-envars.html

May not POSTGRES_PASSWORD and PGPASSWORD ?
And in pg_hba this kind of authentication for this address is mentioned?

Find more questions by tags DockerPostgreSQL