1

I did a Dockerfile and tried to make a request but it was returned an error, my Dockerfile is:

FROM node:lts-slim

WORKDIR /live-code

COPY . .

RUN npm install

EXPOSE 3000

ENTRYPOINT [ "npm", "start" ]

And I ran the command:

docker run -p 3000:3000 IMAGE-NAME
  • *but it was returned an error* So what was the error? – super Feb 16 '22 at 19:13
  • 1
    I tried by Postman and it just returns the connection refused. – Guilherme Garcia Alves Feb 16 '22 at 19:45
  • Does this answer your question? [How do I access a spring app running in a docker container?](https://stackoverflow.com/questions/52633726/how-do-i-access-a-spring-app-running-in-a-docker-container) – ErikMD Feb 16 '22 at 21:40
  • 1. If your app using fastify you need to bind public access to this like this: await fastify.listen(8080, '0.0.0.0') 2. to start you container you need to use the parameter -p like this: docker run -d -p 8080:8080 myapp I guess this could help you. o -p é pra dizer como a nossa host machine vai direcionar pro container – pedrualves Feb 16 '22 at 23:28

0 Answers0