Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
Can't connect to Express server inside Docker container created with docker-compose

I have a stack of a MySQL database, a redis cache and a web server written in Express.

The entire stack is working and connecting to each other correctly. This is my final Node log:

users-service       | debug: [SERVER] Initializing routes
users-service       | debug: starting Route: auth
users-service       | debug: starting Route: flows
users-service       | debug: starting Route: users
users-service       | debug: [SERVER] Listening on port 3001

docker ps tells me that the container is mapping the ports correctly:

CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                    NAMES
f6a99ecdd218        users-service         "nodemon start"          52 minutes ago      Up 2 minutes        0.0.0.0:3001->3001/tcp   users-service
38966d30ec0a        redis                 "docker-entrypoint..."   59 minutes ago      Up 2 minutes        0.0.0.0:6379->6379/tcp   users-service-redis
fb79ec8fb50c        users-service-mysql   "docker-entrypoint..."   About an hour ago   Up 2 minutes        0.0.0.0:3306->3306/tcp   users-service-mysql

Inside the web container, the Node process (nodemon, in this case) is running:

PID   USER     TIME   COMMAND
  1   root     0:00   node /usr/local/bin/nodemon start
 21   root     0:00   sh -c node start start.js
 22   root     0:00   node start start.js
 32   root     0:00   sh
 37   root     0:00   ps

However, when I try to access port 3001 with curl or postman, they simply wait for response till timeout.

An interesting thing is that this don't work only on my machine. In my teammate's machine it goes up and he can connect to port 3001 with no problems.

So I suspect it is a problem with my machine, but I'm not sure what.

I'll appreciate any help. Thank you in advance.

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda