forked from ianblenke/tutum-docker-clusterproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
24 lines (24 loc) · 1.3 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
machine:
services:
- docker
dependencies:
override:
- docker build -t haproxy .
- docker run -d --name web1 tutum/hello-world
- docker run -d --name web2 tutum/hello-world
test:
override:
- docker run -d -p 80:80 --link web1:web1 --link web2:web2 haproxy; sleep 10
- curl --retry 10 --retry-delay 5 -L -I http://localhost | grep "200 OK"
# test virtual host method 1
- docker run -d --name tomcat1 tutum/tomcat
- docker run -d --name glassfish1 tutum/glassfish
- docker run -d --link glassfish1:glassfish1 --link tomcat1:tomcat1 -e BACKEND_PORT=8080 -e VIRTUAL_HOST="tomcat1=www.tomcat.org, glassfish1=www.glassfish.org" -p 8007:80 haproxy; sleep 30
- "curl -H 'Host:www.tomcat.org' 127.0.0.1:8007 | grep 'Apache Tomcat'"
- "curl -H 'Host:www.glassfish.org' 127.0.0.1:8007 | grep 'GlassFish Server'"
# test virtual host method 2
- docker run -d -e VIRTUAL_HOST=www.tomcat.com --name tomcat2 tutum/tomcat
- docker run -d -e VIRTUAL_HOST=www.glassfish.com --name glassfish2 tutum/glassfish
- docker run -d --link glassfish2:glassfish2 --link tomcat2:tomcat2 -e BACKEND_PORT=8080 -p 8008:80 haproxy; sleep 30
- "curl -H 'Host:www.tomcat.com' 127.0.0.1:8008 | grep 'Apache Tomcat'"
- "curl -H 'Host:www.glassfish.com' 127.0.0.1:8008 | grep 'GlassFish Server'"