Skip to content

Conversation

pinkerton
Copy link

@pinkerton pinkerton commented Feb 12, 2018

This reconfigures the project to use Docker Compose, primarily to simplify configuration and make service discovery less manual. Compose makes this particularly simple as it lets us specify apps in docker-compose.yaml that can talk to each other via a network created by default. See the link for more details about how this works.

We can talk to our containers over the ports specified in docker-compose.yaml, which follow the format "host-port:container-port". Docker handles all the networking around forwarding traffic from the host port to the container port.

This cannot be merged as-is, because I think there is an issue around Spring not liking custom hostnames. I suspect there may be an additional method that needs to be called to set a custom hostname on the request in app/.../Controller.java, but did not play with this much myself as I don't have a Java development environment set up, and for some reason requests do not seem to be showing up in the Spring logs that we see when running docker-compose up or docker-compose logs app.

The specific error I get when doing a PUT to http://0.0.0.0:7001/takeFromInventory?name=Chamber&quantity=1 is java.net.ConnectException: Connection refused (Connection refused). The issue does not seem to be with the Docker networking configuration because we're making it to the Java app, and because I can make requests to the inventory app by itself without any issues.

@pinkerton pinkerton changed the title Add container names Move project to Docker Compose Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant