I have this file "docker-compose.yml"
version: '3'
services:
web:
build: .
#command: bash -c "foreman start -f Procfile.dev-server"
ports:
- "3000:3000"
volumes:
- .:/app
environment:
DATABASE_HOST: database
POSTGRES_USER: postgres
POSTGRES_PASSWORD: miclave
POSTGRES_DB: myapp_development
links:
- mailcatcher
depends_on:
- database
stdin_open: true
tty: true
database:
image: postgres
ports:
- "5432:5432"
volumes:
- .:/app
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: miclave
POSTGRES_DB: myapp_development
mailcatcher:
image: zolweb/docker-mailcatcher:latest
ports:
- "1025:1025"
- "1080:1080"
When I try to send an email from my ruby on rails web app I get this error:
Can anybody help me to find out what I am doing wrong?. Thanks

This is because you can't access service through
127.0.0.1. If your services on the same network you will able to access it by thelinksdirective you passed, like change your address from127.0.0.1tomailcatcher. If your services in different networks - you can open ports on service that you need to call and then access it by machine local ip address (not the127.0.0.1but by the your physical/virtual machine ip address in local network)