I'm new to docker and working on dockerising an existing RoR app.
Here's my docker-compose.yml
file:-
version: '3.8'
services:
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
depends_on:
- postgres
ports:
- '3000:3000'
postgres:
image: postgres:latest
On running docker-compose up
, I'm able to map to the rails server but getting the error in the title, looks like postgres is not connecting to the container.
I don't know what to do, I just want to my machine to the rails app in docker conatiner.