nickjj / docker-rails-example

A production ready example Rails app that's using Docker and Docker Compose.
MIT License
941 stars 185 forks source link

Cannot connect to postgres without mapping port #45

Closed johnpitchko closed 1 year ago

johnpitchko commented 1 year ago

Howdy, I'm a novice Docker user kludging my way through learning. Was very excited to discover this repo that features a clean implementation of Rails + Docker w/ best practices; thank you!

One issue I encountered what that I could not access/connect to my running Postgres container using the standard config in your docker-compose.yml file. However, once I manually mapped the port, everything worked fine.

Specifically, I had to add the following under the postgres service in docker-compose.yml:

ports:
  - 5432:5432

I assume your implementation works great for you out of the box yet not on my workstation (2021 M1 MacBook Pro). Any thoughts as to why I had to manually map the port in the config?

nickjj commented 1 year ago

Hi,

This issue was covered in https://github.com/nickjj/docker-rails-example/issues/42, it's unrelated to your M1.