Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Created June 20, 2016 04:04
Show Gist options
  • Save lopezjurip/307f7e757810ab44def5dd919fbce9e3 to your computer and use it in GitHub Desktop.
Save lopezjurip/307f7e757810ab44def5dd919fbce9e3 to your computer and use it in GitHub Desktop.
HAProxy: expose containers with subdomains
webclient:
environment:
- NODE_ENV=production
- VIRTUAL_HOST=myapp.com
build: 'webclient' # this directory must have a Dockerfile
links:
- mongo
restart: always
lb:
image: 'dockercloud/haproxy'
links:
- webclient
- api
ports:
- '80:80'
restart: always
api:
environment:
- NODE_ENV=production
- VIRTUAL_HOST=api.myapp.com
build: 'server' # this directory must have a Dockerfile
links:
- mongo
restart: always
mongo:
image: 'mongo:latest'
restart: always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment