[Erro] could not translate host name "postgres" to addresa

Boa noite estou com o erro abaixo:

Doctrine\DBAL\Driver\PDOException::(“SQLSTATE[08006] [7] could not translate host name “postgres” to address: Name or service not known”)

O erro ocorre após rodar o comando “docker-compose exec php composer new-install”

o meu .env segue…

APP_NAME=i-Educar
APP_ENV=local
APP_KEY=base64:DLiTsZSNpLMg2fh+dcsnNHNaAmr+phDOyLYHyMwABas=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=America/Sao_Paulo
APP_TRACK_ERROR=false
APP_DEFAULT_HOST=ieducar.com.br

API_ACCESS_KEY=
API_SECRET_KEY=

CORE_EXT_CONFIGURATION_ENV="${APP_ENV}"

LEGACY_CODE=true
LEGACY_DISPLAY_ERRORS=false
LEGACY_PATH=ieducar

LOG_CHANNEL=stack

TELESCOPE_ENABLED=false

DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=ieducar
DB_USERNAME=ieducar
DB_PASSWORD=ieducar

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="{PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="{PUSHER_APP_CLUSTER}"

HONEYBADGER_API_KEY=