I'm building a react, Node App and I'm using docker-compose my docker compose definition looks like this:
version: "3"
services:
frontend:
stdin_open: true
container_name: firestore_manager
build:
context: ./client/firestore-app
dockerfile: DockerFile
image: rasilvap/firestore_manager
ports:
- "3000:3000"
volumes:
- ./client/firestore-app:/app
environment:
- BACKEND_HOST=backend
- BACKEND_PORT=8081
depends_on:
- backend
backend:
container_name: firestore_manager_server
build:
context: ./server
dockerfile: Dockerfile
image: rasilvap/firestore_manager_server
ports:
- "8081:8081"
volumes:
- ./server:/app
environment:
- BACKEND_HOST=backend
- BACKEND_PORT=8081
I'm trying to access to the NodeJs backend endpoints using the backend prefix defined in the docker-compose file, but I'm getting an Error: getaddrinfo ENOTFOUND firestore_manager_server, the same is happening using the container name: firestore_manager_server.
As you can see in the next urls:
firestore_manager_server:8081/firestore?collection=test&field=nombre&value=xxxx
backend:8081/firestore?collection=test&field=nombre&value=xxxx
I don't have any problem using localhost.
The next is the result of the docker ps command:
Any ideas?
