$ docker container run -d --name my_proxy -p 80:80 nginx:alpine
$ docker container run -d --name my_web -p 8081:80 httpd:alpine
Here we will implement load balance 'Elasticsearch". What is Elasticsearch?
$ docker network create dude $ docker container run -d --net dude --net-alias search elasticsearch:2
$ docker container run -d --name my_db -e MYSQL_ROOT_PASSWORD=1234 mysql:5.7
` $ docker container run --name my_wordpress --link my_mysql:mysql -p 8081:80 wordpress
First, clone from the following URL to Ubuntu VM:
https://github.com/potikanond/docker-node-sample3.git
On Ubuntu VM run the following command:
This example shows how to use docker-compose
to help deploy multiple containers at once.
We need to create a docker-compose.yml
which is in the YAML format.
This file describes the docker engine how to create the Node.js and MongoDB containers.
The Node.js container will be build from its Dockerfile
inside the application directory.
While the MongoDB container will be created from the MongodB official image.
Note: we will work on this example in the directory of project docker-node-sample3
.