I have a Webapp running completely locally on my MacBook.
The Webapp has a Front End (Angular/Javascript) and a Back End (Python/Django) which implements a RESTful API.
I have Dockerized the Back End so that it is completely self-contained in a Docker Container and exposes port 8000. I map this port locally to 4026.
Now I need to Dockerize the Front End. But if I have these two docker containers running on my localhost, how can I get the FE to send HTTP requests to the BE? The FE container won't know anything that exists outside of it. Right?
This is how I run the FE:
$ http-server
Starting up http-server, serving ./
Available on:
http://127.0.0.1:8080
http://192.168.1.16:8080
Hit CTRL-C to stop the server
Please provide references explaining how I can achieve this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…