Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I'm having issues accessing my postgres db from my remote machine. I'm running docker-compose (django and postgres) from a digitalOcean droplet, so I need to be able to access the db from my mac.

I thought the below would work based on the outline of environment usage in docker-compose. Any help would be appreciated.

db:
  image: postgres
  ports:
    - "5555:5555"
  environment:
    - POSTGRES_PASSWORD=mysecretpassword
    - POSTGRES_USER=postgres
web:
  build: .
  command: python manage.py runserver 0.0.0.0:8000
  volumes:
    - .:/code
  ports:
    - "8000:8000"
  links:
    - db

I'm trying to access the postgres db from pgadmin3 on port 5555, user:postgres, pass:mysecretpassword.

share|improve this question
    
is pgadmin3 running on – Greg Apr 6 at 11:55
    
Did you make postgres listen on port 5555 (does postgresql.conf have port set to 5555 and listen set to *) in container db? If you did, can you 'docker exec -it db bash' and once in, 'psql -p 5555 -h 127.0.0.1 -U postgres' ? – Greg Apr 6 at 12:01
    
Did you figure this out? – miguel5 Apr 21 at 14:14
    
what's your postgres image downloaded? – kikicarbonell Jun 11 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.