Hi there,
we are trying to set up a rails app and built two containers - one with the app and one with the db. The connection between the containers works fine, but I cannot reach my app from the host:
Verbindungsaufbau zu 0.0.0.0:3000 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … Lesefehler (Die Verbindung wurde vom Kommunikationspartner zurückgesetzt) beim Vorspann (header).
Erneuter Versuch
In english something like:
connection to 0.0.0.0:3000 … connected
http request sent waiting for answer … read error (connection resetted by peer) at header
re-trying
The Port seems to be exposed, as ‘container ls’ shows:
CONTAINER ID ... PORTS
b69e506f8a84 ... 0.0.0.0:3000->3000/tcp
Our docker-compose.yml:
version: '3.4'
services:
didpdb:
image: mariadb:10.3
volumes:
- ./tmp/db:/var/lib/mysql
networks:
- dbconnection
environment:
MYSQL_ROOT_PASSWORD: whatever
didpapp:
build: .
command: bundle exec rails s
networks:
- dbconnection
ports:
- '3000:3000'
depends_on:
- didpdb
networks:
dbconnection:
driver: bridge
Linux Mint 19
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.17.1, build unknown
It’s funny, that the db-container exposes its port 3306 to the host, though it is not defined in the docker-compose.yml. I can see it with a portscan. But the app container’s ports are all closed according to the scan.
Can anyone point us to the right direction?
Thanks in advance.