I did not include the real password. And the ip are intern but I will remove the link. Where can I find the json? You mention?
About typo3 it is just as every php code just connecting to the database nothing fancy. Yes they are in the same Stack.
so here is what you mentioned I hope 
'DB' => [
'Connections' => [
'Default' => [
'charset' => 'utf8mb4',
'defaultTableOptions' => [
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'driver' => 'mysqli',
'host' => ‘my.special-server.com:8080',
'password' => ‘pass_ww ,
'port' => 3307,
'user' => 'admin_ ',
],
],
],
Labels:{
com.docker.compose.config-hash:"c6d727da2220438feb60f0e4e71faef65c08ddb4ae8c43087d44736f8bcf755c",
com.docker.compose.container-number:"1",
com.docker.compose.depends_on:"",
com.docker.compose.image:"sha256:bb21c581c0137432cd1553b8a1fe314525828eb04c70be1c77f37e3a2542091c",
com.docker.compose.oneoff:"False",
com.docker.compose.project:"mysql_version_8",
com.docker.compose.project.config_files:"/data/compose/1/docker-compose.yml",
com.docker.compose.project.working_dir:"/data/compose/1",
com.docker.compose.service:"db",
com.docker.compose.version:""
},
NetworkSettings:{
Networks:{
mysql_version_8_default:{
Aliases:[
"mysqlV8",
"db",
"12330451d16f"
],
DNSNames:[
"mysqlV8",
"db",
"12330451d16f"
],
DriverOpts:null,
EndpointID:"d1fd2214cdeec209b7157b1691ad569fdc84ed28bda0b10f000d705a1fa2d144",
Gateway:"172.18.0.1",
GlobalIPv6Address:"",
GlobalIPv6PrefixLen:0,
GwPriority:0,
IPAMConfig:null,
IPAddress:"172.18.0.2",
IPPrefixLen:16,
IPv6Gateway:"",
Links:null,
MacAddress:"big mac with fries",
NetworkID:"the id was here"
}
},
Ports:{
3306/tcp:[
{
HostIp:"0.0.0.0",
HostPort:"3307"
},
{
HostIp:"::",
HostPort:"3307"
}
],
33060/tcp:null
},
SandboxID:"a0033ad3d261a8c8e51461b1bc8d62ad45be9bdb2d81ce1fa50c0f3425872a6a",
SandboxKey:"/var/run/docker/netns/a0033ad3d261"
},
Labels:{
com.docker.compose.config-hash:"612e27807cfdd8526ead74f20c958dba220b9b0e32c9c6e9a9d39f883b198061",
com.docker.compose.container-number:"1",
com.docker.compose.depends_on:"db:service_started:false",
com.docker.compose.image:"sha256:42a200db07b4e70fbf32c594ad4521cf16399b8e54bbb5adceae98e7566dfbeb",
com.docker.compose.oneoff:"False",
com.docker.compose.project:"mysql_version_8",
com.docker.compose.project.config_files:"/data/compose/1/docker-compose.yml",
com.docker.compose.project.working_dir:"/data/compose/1",
com.docker.compose.service:"phpmyadmin",
com.docker.compose.version:"",
org.opencontainers.image.authors:"The phpMyAdmin Team <developers@phpmyadmin.net>",
org.opencontainers.image.description:"Run phpMyAdmin with Alpine, Apache and PHP FPM.",
org.opencontainers.image.documentation:"https://github.com/phpmyadmin/docker#readme",
org.opencontainers.image.licenses:"GPL-2.0-only",
org.opencontainers.image.source:"https://github.com/phpmyadmin/docker.git",
org.opencontainers.image.title:"Official phpMyAdmin Docker image",
org.opencontainers.image.url:"https://github.com/phpmyadmin/docker#readme",
org.opencontainers.image.vendor:"phpMyAdmin",
org.opencontainers.image.version:"5.2.3"
},
NetworkSettings:{
Networks:{
mysql_version_8_default:{
Aliases:[
"phpmyadmin8",
"phpmyadmin",
"d43352a8b035"
],
DNSNames:[
"phpmyadmin8",
"phpmyadmin",
"d43352a8b035"
],
DriverOpts:null,
EndpointID:"029999cd07d6546c02d1759bb7cc7719a22cc997e286a38ba709e7fa19378bd6",
Gateway:"172.18.0.1",
GlobalIPv6Address:"",
GlobalIPv6PrefixLen:0,
GwPriority:0,
IPAMConfig:null,
IPAddress:"172.18.0.3",
IPPrefixLen:16,
IPv6Gateway:"",
Links:null,
MacAddress:"no big mac adddres here",
NetworkID:"show me your id"
}
},
Ports:{
80/tcp:[
{
HostIp:"0.0.0.0",
HostPort:"8080"
},
{
HostIp:"::",
HostPort:"8080"
}
]
},
SandboxID:"here some id",
SandboxKey:"/var/run/docker/netns/c9056d54d4d9"
},
This was the config- typo which has been working previous. no longer on line so can not test this.
'DB' => [
'Connections' => [
'Default' => [
'charset' => 'utf8mb4',
'dbname' => 'dev13_typo3_database',
'defaultTableOptions' => [
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'driver' => 'pdo_mysql',
'host' => '172.18.0.2',
'password' => 'the unknow password secret',
'port' => 3307,
'user' => 'admin_user_secret',
],
],
],
If I use these setting in the typo3 cms I try to create new it says:
Database connect not successful
Connecting to the database with given settings failed: An exception occurred in the driver: Access denied for user 'admin_user '@'172.18.0.1' (using password: YES)
why 172.18.0.1 and not 172.18.0.2 ?