Docker Community Forums

Share and learn in the Docker community.

Configurable web application container that connect to other containers

Hi,

First of all, I apologize if my questions does not make sense. I am relatively new to the Docker technologies.
I am wondering how I can build a configurable containerized Docker web application that pulls and displays data from other containerized Docker applications. The goal here is rather than creating a web application container for each containerized application, there will be only one web application container that will be pulling data from any other containerized application once the user enters the configurations for the container application they interested in displaying. What technologies and tools should I be using to achieve this? I would greatly appreciate any recommendation and resources to guide me in this. Thanks in advance.

Hi

If I understand you correctly, I think you need to take another approach, instead of pulling data from other containers, you should have an image that is pre configured that the user can run.

But I might be misunderstanding your question since you give very little info on what you’re actually trying to accomplish or examples of this :slight_smile:

Hi,

Thank you very much for your prompt response. Hypothetically speaking, let’s say there are 10 X containers that are very similar to each other doing very similar jobs. What I could do is build a web app in each of the containers and display certain data via UI. But this approach would make containers larger than they need to be. Rather what I would like to do is since these 10 X containers share common properties, I want to have one web app UI container that can be configured by the user depending on which X container they want to run out of 10 X containers. Hope this example clarifies my question :slightly_smiling_face:

If I use a pre configured image, I am assuming the users cannot configure what container they would like to use in the runtime. I might be wrong.
I very appreciate your help!

If you want to use your approach, you can either use volumes, that the containers share, or if you want to use the data from another container, you can use --volume-from ( docker run -ti --name=Container2 --volumes-from Container1 ubuntu )

BUT, I still think maybe just having a pre configured image is better, because then they can START the container, from your image when they need it, instead of having it available at all time.
This way you can also push changes to that image, and the next time they run that image, your changes will be in it.

Thank you very much for the suggestions. If I use the volumes, will users be able to configure (Assuming by entering container app credentials they would like to run) their environments in the run time via containerized UI to access data from other containerized applications?

In case of using a pre-configured image, your suggestion is that I just simply do the configurations from my UI container image to other containerized applications for the users and the users can select the containers they are interested in to see data from. Which requires me to put a list of available X1, X2, X3 etc. container to choose from. Am I understanding your suggestion right?

So connecting to another container is as simple as using this alias as the name of the host. You need to link rabbitmq and redis to your webapps container and not the other way arround. First run redis and rabbitmq containers. Then run webapps container with links to the 2 containers.