Error during migration run: “no PostgreSQL user name specified in startup packet”

When I go docker-compose up, I get this error:

yarn run v1.15.2
$ yarn migrate:run && yarn start
$ yarn typeorm migration:run --config ./lib/src/ormconfig
$ /usr/src/app/node_modules/.bin/typeorm migration:run --config ./lib/src/ormconfig
Error during migration run:
{ error: no PostgreSQL user name specified in startup packet
at Connection.parseE (/usr/src/app/node_modules/pg/lib/connection.js:606:11)
at Connection.parseMessage (/usr/src/app/node_modules/pg/lib/connection.js:403:19)
at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:123:22)
at Socket.emit (events.js:193:13)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:276:11)
at Socket.Readable.push (_stream_readable.js:231:10)
at TCP.onStreamRead (internal/stream_base_commons.js:154:17)
name: 'error',
length: 121,
severity: 'FATAL',
code: '28000',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'postmaster.c',
line: '2217',
routine: 'ProcessStartupPacket' }
error Command failed with exit code 1.

Whereas I have already specified the allegedly missing user name in my docker-compose.yml file.

Where else should I ass the user name? Or is the error referencing something completely different?

db: postgres:9.6