Networking Between Docker Containers
If you don't want to use a docker-compose file for whatever reason you can create networking between containers manually.
This can be achieved only on the same network!
How to set networking for DecisionRules in docker
How to setup multi-container app
What containers will we need:
Server App
Client App
Business Intelligence App
Redis
MongoDB
Method 1: Setup with terminal
First of all, we need to create a docker network because containers, by default, don't see other containers thus they cannot communicate with each other. We will use a simple command docker network create
Note: If you are using PowerShell on Windows you need to use `` for multi-line command!
In the second step, we need to run all mandatory containers mentioned above. We will do it with the help of docker run
. In this command, we will set ports and env variables as well.
If the command is successful it prints containers id
-d
flags that can be interpreted as-d -p
which is a detached mode with exposed ports. Detached mode means that the container runs in the background and grimly does its work.
Your env properties configuration may vary. For all possibilities go here
Hurray! It is done. Now you can go to localhost:80 a DecisionRules should be up and running.
Method 2: Setup with docker-compose file
You can use docker-compose for a very easy setup.
Run docker-compose with docker compose up
command
Last updated