Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- webapp: # this can be renamed to any name of choice
- image: webapp:latest # replace this with your web app docker image
- expose:
- - "3000" # any ports that you app is exposing
- restart: always
- depends_on:
- - redis
- links:
- - redis
- environment:
- - REDIS_HOST= redis # DNS for redis to be accessed by your app
- - VIRTUAL_HOST=*/mywebapp/, */mywebapp/* # path for app eg. localhost:8080/mywebapp/
- - EXTRA_SETTINGS=reqrep ^([^\ :]*)\ /mywebapp/(.*) \1\ /\2 # Optional: used to path rewrite
- networks: # Optional
- - mynet
- redis:
- image: redis
- expose:
- - "6379"
- volumes:
- - "redis-data:/data"
- command: redis-server --appendonly yes
- networks: # Optional
- - mynet
- lbapp:
- image: dockercloud/haproxy
- links:
- - webapp # Name of the backend service that you want to be load balanced
- volumes:
- - "/var/run/docker.sock:/var/run/docker.sock"
- ports:
- - "8080:80" # Map lb's port 80 to 8080 that can be used to accessed lb from outside
- networks: # Optional
- - mynet
- networks: # Optional
- mynet:
- volumes:
- redis-data:
Add Comment
Please, Sign In to add comment