Docker - Unable to access postgres DB

Multi tool use
Multi tool use


Docker - Unable to access postgres DB



im trying to setup NextCloud on Postgres with Docker but im unable to access/reach the postgress container from the nextcloud setup page.
Here is my setup:


docker network create --driver bridge nextcloud

docker run -p 127.0.0.1:5432:5432
--name postgres
--link cloud.mydomain.com
--net=nextcloud
-e POSTGRES_PASSWORD=supersecretpass123
-e POSTGRES_USER=nextcloud
-e POSTGRES_DB=nextcloud
-v postgres-data:/var/lib/postgresql/data
-d postgres


docker run -d -p 127.0.0.1:8080:80
--name="cloud.mydomain.com"
-e VIRTUAL_HOST=cloud.mydomain.com
-v nextcloud:/var/www/html
--net=nextcloud
nextcloud


docker run -d -p 80:80 -p 443:443 --name="cloud.mydomain.com-proxy"
--net=nextcloud
-v /srv/gitlab:/etc/nginx/vhost.d:ro
-v /root/certs:/etc/nginx/certs
-v /var/run/docker.sock:/tmp/docker.sock:ro
--restart always
jwilder/nginx-proxy:latest



Any Suggestion?




1 Answer
1



You need to invert the link, add the --link postgres to cloud.mydomain.com:


--link postgres


docker run -d -p 127.0.0.1:8080:80
--name="cloud.mydomain.com"
--link postgres
-e VIRTUAL_HOST=cloud.mydomain.com
-v nextcloud:/var/www/html
--net=nextcloud
nextcloud






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

p qlXyb845fACCj4t2RwEoO OjMAz,8kl7SI 1kzAEP vBM NQlcjw10,bN48v
WPvlfbo5 LMAYdfe vrTs9sX9zWQR 9H,Vt8,N9k3Rm sOtm5gm6GI7oNDiNWWPITACq2QhH,K

Popular posts from this blog

Delphi Android file open failure with API 26

.

Amasya