In this step, we will run a flask application that communicates with our existing Redis instance.
Task
Running following command to run redis container and attach to custom network my-network
created in the first step
docker run -d --name=redis --net=my-network redis
Similarly, launch the web server using the flask image and attach to the same network. So, it will be able to communicate with our Redis instance. Also, use -p 5000:5000
parameter to map ports.
Protip
You can verify that the containers are communicating by selecting Dashboard
and clicking reload icon. This dashboard is connected to Port 5000
of the docker host.
docker run -d -p 5000:5000 --net=my-network redis-flask-example