在docker和rancher中创build负载平衡器

我正尝试在Debian框中设置Docker和Rancher的testing环境。 为了能够重现加载的环境,我想基于compose和dockerfile文件构build一切。 基本的架构是一个基于tomcat的前端和postgres数据库。 我想要使​​用负载平衡属性。 我已经通过GUI成功地构build了它,但是我有通过docker撰写文件来重现它的方法。

我在github上find了tomcat和postgres的dockerfile图像。 目前他们很简单:

FROM tomcat:9.0 

 FROM postgres:latest 

docker-compose.yml包含以下内容:

 version: '2' services: lb: image: rancher/lb-service-haproxy:v0.7.9 ports: - 9000:9000/tcp labels: io.rancher.container.agent.role: environmentAdmin io.rancher.container.create_agent: 'true' scale: 1 lb_config: port_rules: - priority: 1 protocol: http source_port: 9000 target_port: 8080 service: web web: build: https://raw.githubusercontent.com/xxxx/tomcatweb links: - database:db volumes: - /home/dockserver/stacks/webapps:/usr/local/tomcat/webapps/ - /home/dockserver/stacks/logs:/usr/local/tomcat/logs/ scale: 2 database: build: https://raw.githubusercontent.com/xxxx/postgres ports: - "9432:5432" environment: POSTGRES_PASSWORD: xxxx 

有了这个configuration,所有的容器都被正确地加载了,并且是活动的,但是我看不到url http://:9000上的tomcattesting页面

我错过了什么? 我怀疑这个问题可能在端口configuration附近,但是我所做的每一个尝试都没有成功。