0

I have an angular application in a container and want to make it call my API that is in my docker host. I want to do it so I could debug my API and make some tests.

This is my dockerfile:

FROM node:6.9.5-alpine
COPY . .
RUN npm install

CMD ["npm", "start"]

How can I make it call my API that is in my docker host using a HTTP request?

luturol
  • 565
  • 8
  • 12

1 Answers1

0

If you are trying to reach the host from the docker you can use host.docker.internal which would translate to the address of the host.

murat
  • 14
  • 3
  • if i add the `host.docker.internal:ports` in the call it will work? – luturol Nov 08 '19 at 12:57
  • I can run `curl host.docker.internal:9000 -v` from inside my container to reach a port on the host. So I would assume this should work for you too. – murat Nov 08 '19 at 13:49