From b15e3aae5c4932ff524f0b9ce38aafe75eae3fb3 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 16 Jan 2018 15:46:18 +0000 Subject: [PATCH] Update README.md --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3d99025..d911abb 100755 --- a/README.md +++ b/README.md @@ -11,23 +11,33 @@ Example on how to setup a Wildfly cluster using Docker

## 建立docker image +1. 本地端建立 +``` +./build.sh +``` + +2. Pull from docker hub +``` +docker pull shihxuancheng/wildfly-cluster:latest +``` -## 如何執行 +## 執行 1. 透過**docker cli** 建立private network ``docker network create --driver=bridge --subnet=172.28.0.0/16 --ip-range=172.28.5.0/24 --gateway=172.28.5.254 wildnetwork`` 執行並執行wildfly docker container - ``docker run -d -p 8081:8080 -p 9991:9990 --name wild1 --network wildnetwork shihxuancheng/wildfly-cluster`` - ``docker run -d -p 8082:8080 -p 9992:9990 --name wild2 --network wildnetwork shihxuancheng/wildfly-cluster`` + ``docker run -d -p 8081:8080 -p 9991:9990 --name wild1 -h wild1 --network wildnetwork -l traefik.backend=wild1 -l traefik.frontend.rule=PathPrefix:/zkweb shihxuancheng/wildfly-cluster`` + + ``docker run -d -p 8082:8080 -p 9992:9990 --name wild2 -h wild2 --network wildnetwork -l traefik.backend=wild1 -l traefik.frontend.rule=PathPrefix:/zkweb shihxuancheng/wildfly-cluster`` 建立並執行traefik docker container - ``docker run -d -p 8080:8080 -p 80:80 -v $PWD/traefik.toml:/etc/traefik/traefik.toml traefik`` + ``docker run -d -p 8080:8080 -p 80:80 --name wild-balancer --network wildnetwork -l traefik.enable=false -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/traefik.toml:/etc/traefik/traefik.toml traefik`` 2. 透過**docker compose** ``` docker-compose up -d -``` +``` ## 參考 * [Traefik](https://traefik.io/)