-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished up the environment for the test
- Loading branch information
1 parent
e50f9b6
commit 44d41ae
Showing
6 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
server_name _; | ||
|
||
location = /robots.txt { | ||
add_header Content-Type text/plain; | ||
return 200 "User-agent: *\nAllow: /"; | ||
} | ||
location / { | ||
proxy_pass http://httpd-upstream; | ||
# proxy_cookie_path ~*^/.* /; | ||
# proxy_set_header Host $http_host; | ||
# proxy_set_header X-Forwarded-Host $host; | ||
# proxy_set_header X-Forwarded-Server $host; | ||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
# proxy_set_header X-Real-IP $remote_addr; | ||
# proxy_redirect off; | ||
} | ||
} | ||
|
||
upstream httpd-upstream { | ||
server httpd-01:80; | ||
server httpd-02:80; | ||
server httpd-03:80; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
function info () { | ||
info "\e[32mINFO:\e[0m $1" | ||
} | ||
|
||
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
NETWORK_NAME="test-lan" | ||
if [[ $(docker network ls | grep ${NETWORK_NAME}) ]]; then | ||
info "found docker network: ${NETWORK_NAME}" | ||
else | ||
info "did not find docker network, creating docker network: ${NETWORK_NAME}" | ||
docker network create ${NETWORK_NAME} | ||
fi | ||
|
||
echo 'stand up three httpd hosts, httpd-01 - httpd-03' | ||
for host in 01 02 03; do | ||
info "creating httpd-${host}" | ||
docker run -dit --name=httpd-${host} --net=${NETWORK_NAME} --log-driver=json-file -v "$CWD/html/":/usr/local/apache2/htdocs/:rw httpd:2.4.34-alpine | ||
done | ||
|
||
info 'stand up haproxy' | ||
docker run -dit --name=haproxy --log-driver=json-file --net=${NETWORK_NAME} -v "${CWD}/haproxy/":/usr/local/etc/haproxy/:rw -p 9001:80 haproxy:1.8-alpine | ||
|
||
info 'stand up nginx' | ||
docker run -dit --name=nginx --log-driver=json-file --net=${NETWORK_NAME} -v "${CWD}/nginx/":/etc/nginx/:rw -p 9002:80 nginx:1.15.2-alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
docker ps -aq | xargs docker stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
docker ps -aq | xargs docker stop | xargs docker rm |