Postgresql connection fail after docker compose

I’m using JHipster and when I start the app using docker-compose the app can’t connect to database. Is it necessary create a database user when start?

gestao-app_1         | org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"

app.yml

version: '2'
services:
  gestao-app:
    image: gestao
    environment:
      - _JAVA_OPTIONS=-Xmx512m -Xms256m
      - SPRING_PROFILES_ACTIVE=prod,swagger
      - MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true
      - SPRING_DATASOURCE_URL=jdbc:postgresql://gestao-postgresql:5432/mydb
      - JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
    ports:
      - 8080:8080
  gestao-postgresql:
    extends:
      file: postgresql.yml
      service: gestao-postgresql

postgresql.yml

version: '2'
services:
  gestao-postgresql:
    image: postgres:11.3
    volumes:
      - ~/volumes/jhipster/Gestao/postgresql/:/var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=1234
      - POSTGRES_DB=mydb
    ports:
      - 5432:5432

application-prod.yml

datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:postgresql://localhost:5432/gestao_dev
    username: gestao
    password: gestao
    hikari:
      poolName: Hikari
      auto-commit: false

Source: Docker Questions