'Can send HTTP requests from one NodeJS Docker container on Laptop to other NodeJS Docker container on Raspberry Pi, but not vice versa
I have a robot where I am running a NodeJS server under Docker Compose v2. On my laptop I am running another NodeJS server under Docker Compose. Both containers are setup more or less the same. Here is the docker-compose.yaml:
version: "3.9"
services:
server:
build: ./
command: npm run dev:start
volumes:
- ./:/usr/app
- /usr/app/node_modules
network_mode: host
ports:
- "${PORT}:${PORT}"
depends_on:
- db
db:
image: mariadb:10.6
volumes:
- db_data:/var/lib/mysql
- ./db_init/:/docker-entrypoint-initdb.d/
environment:
MARIADB_RANDOM_ROOT_PASSWORD: yes
DB_ADMIN_PASSWORD: ${DB_ADMIN_PWD}
DB_APP_PASSWORD: ${DB_PWD}
ports:
- "${DB_PORT}:3306"
volumes:
db_data:
Network is managed by DHCP on the robot:
- Laptop: 192.168.11.200, NodeJS port 8100
- Robot: 192.168.11.110, NodeJS port 8000
I can send HTTP requests from the laptop to the robot (both are running Ubuntu). But not in the other direction, neither does work CURL. I can ping both machines from both each other. It did work via Ethernet the week before, that I used to setup manually. So I'm quite stupified why it doesn't work with WiFi anymore.
I also have a Docker container with a frontend running on the laptop. It can reach the backend.
Any idea what the issue could be? Is that a problem with the network or Docker setup?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|