digisic / digitalbank-gen-one

A Sample Online Banking Application
https://digisic.github.io/digitalbank-gen-one
MIT License
43 stars 68 forks source link

Docker Compose: digitalbank and digitalcredit are mapped to the same host port #19

Closed AutomicDemo closed 4 years ago

AutomicDemo commented 4 years ago

In the docker compose files for Digital-Bank the "credit:" and "bank:" service both map to the same host port: `credit: . . . ports:

asburymr commented 4 years ago

Can you clarify the issue? Below is how it works today. Let me know if this helps or you are still experiencing an issue with the current configuration.

Digital Bank is mapping the internal container port of 8080 to the docker host machine port 8080. Digital Credit is mapping internal container port of 8080 to the docker host machine port 3500. These ports should not conflict with each other.

Digital Bank is accessing the Digital Credit service on the internal container network (i.e. container to container communication) on port 8080 which is fine. However, if you want to access the Digital Credit API from external to the Docker container network then you would be accessing Digital Credit using the docker host port 3500. For example, http://[dockerhost]:3500/credit/swagger-ui.html.

AutomicDemo commented 4 years ago

Dammit, never mind. My 1AM in the morning addled brain mixed this up. Got the port order reversed while looking for a culprit to a GCP firewall port-priority problem. In real life I frequently mix up my left and right too. Sorry to bother you :)