Hello! I am trying to use nextcloud in docker (with apache) and to connect with a postgres sql server on the host. Postgres is accepting remote connections and nextcloud user is added in the host (i have tested

This is the image from a windows computer
hence, with this established I have the following docker-compose file
version: '3.7'
services:
app:
container_name: nextcloud
image: nextcloud
restart: always
volumes:
- /var/lib/nextcloud/app:/var/www/html:rw
- /media/storage/srv/nextcloud:/var/www/html/data:rw
- /var/log/nextcloud:/var/log
ports:
- 8084:80
environment:
- NEXTCLOUD_ADMIN_USER=
- NEXTCLOUD_ADMIN_PASSWORD=
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=
- POSTGRES_HOST=192.168.10.100
env_file:
- .env
With this, I get the error in the apache root (whith is /media/storage/srv/nextcloud)
{âreqIdâ:âTWK0LMn0j24hrEXSjiIRâ,âlevelâ:3,âtimeâ:â2020-12-22T10:37:17+00:00â,âremoteAddrâ:â86.121.173.219â,âuserâ:"â",âappâ:âcoreâ,âmethodâ:âGETâ,âurlâ:"/",âmessageâ:{âExceptionâ:âDoctrine\DBAL\DBALExceptionâ,âMessageâ:âFailed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolutionâ,âCodeâ:0,âTraceâ:[{âfileâ:"/var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",âlineâ:1449,âfunctionâ:âconnectâ,âclassâ:âOC\DB\Connectionâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",âlineâ:892,âfunctionâ:âgetWrappedConnectionâ,âclassâ:âDoctrine\DBAL\Connectionâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/DB/Connection.php",âlineâ:202,âfunctionâ:âexecuteQueryâ,âclassâ:âDoctrine\DBAL\Connectionâ,âtypeâ:"->",âargsâ:[âSELECT * FROM oc_appconfig
â,[],[],null]},{âfileâ:â/var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.phpâ,âlineâ:206,âfunctionâ:âexecuteQueryâ,âclassâ:âOC\DB\Connectionâ,âtypeâ:"->",âargsâ:[âSELECT * FROM oc_appconfig
â,[],[]]},{âfileâ:â/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.phpâ,âlineâ:217,âfunctionâ:âexecuteâ,âclassâ:âDoctrine\DBAL\Query\QueryBuilderâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppConfig.php",âlineâ:345,âfunctionâ:âexecuteâ,âclassâ:âOC\DB\QueryBuilder\QueryBuilderâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppConfig.php",âlineâ:110,âfunctionâ:âloadConfigValuesâ,âclassâ:âOC\AppConfigâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppConfig.php",âlineâ:301,âfunctionâ:âgetAppsâ,âclassâ:âOC\AppConfigâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/legacy/OC_App.php",âlineâ:949,âfunctionâ:âgetValuesâ,âclassâ:âOC\AppConfigâ,âtypeâ:"->",âargsâ:[false,âinstalled_versionâ]},{âfileâ:"/var/www/html/lib/private/Server.php",âlineâ:668,âfunctionâ:âgetAppVersionsâ,âclassâ:âOC_Appâ,âtypeâ:"::",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",âlineâ:155,âfunctionâ:âOC\{closure}â,âclassâ:âOC\Serverâ,âtypeâ:"->",âargsâ:["*** sensitive parameters replaced "]},{âfileâ:"/var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php",âlineâ:118,âfunctionâ:âOC\AppFramework\Utility\{closure}â,âclassâ:âOC\AppFramework\Utility\SimpleContainerâ,âtypeâ:"->",âargsâ:[" sensitive parameters replaced "]},{âfileâ:"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",âlineâ:122,âfunctionâ:âoffsetGetâ,âclassâ:âPimple\Containerâ,âtypeâ:"->",âargsâ:[âOC\Memcache\Factoryâ]},{âfileâ:"/var/www/html/lib/private/ServerContainer.php",âlineâ:156,âfunctionâ:âqueryâ,âclassâ:âOC\AppFramework\Utility\SimpleContainerâ,âtypeâ:"->",âargsâ:[âOC\Memcache\Factoryâ,true]},{âfileâ:"/var/www/html/lib/private/Server.php",âlineâ:1677,âfunctionâ:âqueryâ,âclassâ:âOC\ServerContainerâ,âtypeâ:"->",âargsâ:[âOC\Memcache\Factoryâ]},{âfileâ:"/var/www/html/lib/private/Server.php",âlineâ:1017,âfunctionâ:âgetMemCacheFactoryâ,âclassâ:âOC\Serverâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",âlineâ:155,âfunctionâ:âOC\{closure}â,âclassâ:âOC\Serverâ,âtypeâ:"->",âargsâ:[" sensitive parameters replaced "]},{âfileâ:"/var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php",âlineâ:118,âfunctionâ:âOC\AppFramework\Utility\{closure}â,âclassâ:âOC\AppFramework\Utility\SimpleContainerâ,âtypeâ:"->",âargsâ:[" sensitive parameters replaced "]},{âfileâ:"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",âlineâ:122,âfunctionâ:âoffsetGetâ,âclassâ:âPimple\Containerâ,âtypeâ:"->",âargsâ:[âOCP\Lock\ILockingProviderâ]},{âfileâ:"/var/www/html/lib/private/ServerContainer.php",âlineâ:156,âfunctionâ:âqueryâ,âclassâ:âOC\AppFramework\Utility\SimpleContainerâ,âtypeâ:"->",âargsâ:[âOCP\Lock\ILockingProviderâ,true]},{âfileâ:"/var/www/html/lib/private/Server.php",âlineâ:1977,âfunctionâ:âqueryâ,âclassâ:âOC\ServerContainerâ,âtypeâ:"->",âargsâ:[âOCP\Lock\ILockingProviderâ]},{âfileâ:"/var/www/html/lib/private/Files/View.php",âlineâ:118,âfunctionâ:âgetLockingProviderâ,âclassâ:âOC\Serverâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/Server.php",âlineâ:395,âfunctionâ:"__construct",âclassâ:âOC\Files\Viewâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",âlineâ:155,âfunctionâ:âOC\{closure}â,âclassâ:âOC\Serverâ,âtypeâ:"->",âargsâ:[" sensitive parameters replaced "]},{âfileâ:"/var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php",âlineâ:118,âfunctionâ:âOC\AppFramework\Utility\{closure}â,âclassâ:âOC\AppFramework\Utility\SimpleContainerâ,âtypeâ:"->",âargsâ:[" sensitive parameters replaced ***"]},{âfileâ:"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php",âlineâ:122,âfunctionâ:âoffsetGetâ,âclassâ:âPimple\Containerâ,âtypeâ:"->",âargsâ:[âOC\Files\Node\HookConnectorâ]},{âfileâ:"/var/www/html/lib/private/ServerContainer.php",âlineâ:156,âfunctionâ:âqueryâ,âclassâ:âOC\AppFramework\Utility\SimpleContainerâ,âtypeâ:"->",âargsâ:[âOC\Files\Node\HookConnectorâ,true]},{âfileâ:"/var/www/html/lib/private/Server.php",âlineâ:1324,âfunctionâ:âqueryâ,âclassâ:âOC\ServerContainerâ,âtypeâ:"->",âargsâ:[âOC\Files\Node\HookConnectorâ]},{âfileâ:"/var/www/html/lib/base.php",âlineâ:595,âfunctionâ:âbootâ,âclassâ:âOC\Serverâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/base.php",âlineâ:1091,âfunctionâ:âinitâ,âclassâ:âOCâ,âtypeâ:"::",âargsâ:[]},{âfileâ:"/var/www/html/index.php",âlineâ:35,âargsâ:["/var/www/html/lib/base.php"],âfunctionâ:ârequire_onceâ}],âFileâ:"/var/www/html/lib/private/DB/Connection.php",âLineâ:72,âCustomMessageâ:"â"},âuserAgentâ:âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36â,âversionâ:â16.0.3.0â}
{âreqIdâ:âTWK0LMn0j24hrEXSjiIRâ,âlevelâ:3,âtimeâ:â2020-12-22T10:37:17+00:00â,âremoteAddrâ:â86.121.173.219â,âuserâ:"â",âappâ:âcoreâ,âmethodâ:âGETâ,âurlâ:"/",âmessageâ:{âExceptionâ:âDoctrine\DBAL\DBALExceptionâ,âMessageâ:âFailed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolutionâ,âCodeâ:0,âTraceâ:[{âfileâ:"/var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",âlineâ:1449,âfunctionâ:âconnectâ,âclassâ:âOC\DB\Connectionâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",âlineâ:892,âfunctionâ:âgetWrappedConnectionâ,âclassâ:âDoctrine\DBAL\Connectionâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/DB/Connection.php",âlineâ:202,âfunctionâ:âexecuteQueryâ,âclassâ:âDoctrine\DBAL\Connectionâ,âtypeâ:"->",âargsâ:[âSELECT * FROM oc_appconfig
â,[],[],null]},{âfileâ:â/var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.phpâ,âlineâ:206,âfunctionâ:âexecuteQueryâ,âclassâ:âOC\DB\Connectionâ,âtypeâ:"->",âargsâ:[âSELECT * FROM oc_appconfig
â,[],[]]},{âfileâ:â/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.phpâ,âlineâ:217,âfunctionâ:âexecuteâ,âclassâ:âDoctrine\DBAL\Query\QueryBuilderâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppConfig.php",âlineâ:345,âfunctionâ:âexecuteâ,âclassâ:âOC\DB\QueryBuilder\QueryBuilderâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppConfig.php",âlineâ:110,âfunctionâ:âloadConfigValuesâ,âclassâ:âOC\AppConfigâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/AppConfig.php",âlineâ:301,âfunctionâ:âgetAppsâ,âclassâ:âOC\AppConfigâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/legacy/OC_App.php",âlineâ:949,âfunctionâ:âgetValuesâ,âclassâ:âOC\AppConfigâ,âtypeâ:"->",âargsâ:[false,âinstalled_versionâ]},{âfileâ:"/var/www/html/lib/private/TemplateLayout.php",âlineâ:185,âfunctionâ:âgetAppVersionsâ,âclassâ:âOC_Appâ,âtypeâ:"::",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/legacy/OC_Template.php",âlineâ:183,âfunctionâ:"__construct",âclassâ:âOC\TemplateLayoutâ,âtypeâ:"->",âargsâ:[âerrorâ,""]},{âfileâ:"/var/www/html/lib/private/Template/Base.php",âlineâ:132,âfunctionâ:âfetchPageâ,âclassâ:âOC_Templateâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/lib/private/legacy/OC_Template.php",âlineâ:332,âfunctionâ:âprintPageâ,âclassâ:âOC\Template\Baseâ,âtypeâ:"->",âargsâ:[]},{âfileâ:"/var/www/html/index.php",âlineâ:63,âfunctionâ:âprintExceptionErrorPageâ,âclassâ:âOC_Templateâ,âtypeâ:"::",âargsâ:[{âclassâ:âDoctrine\DBAL\DBALExceptionâ},500]}],âFileâ:"/var/www/html/lib/private/DB/Connection.php",âLineâ:72,âCustomMessageâ:"â"},âuserAgentâ:âMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36â,âversionâ:â16.0.3.0â}
I have tried a few options in the docker compose, but per my understanding this is a documentatioon bug or I am missing something. I hope my issue will help others as well and I am offering to write a post or some clarification.
Regards,
Daniel