Guest User

Untitled

a guest
May 16th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. version: '3'
  2. services:
  3. webapp: # this can be renamed to any name of choice
  4. image: webapp:latest # replace this with your web app docker image
  5. expose:
  6. - "3000" # any ports that you app is exposing
  7. restart: always
  8. depends_on:
  9. - redis
  10. links:
  11. - redis
  12. environment:
  13. - REDIS_HOST= redis # DNS for redis to be accessed by your app
  14. - VIRTUAL_HOST=*/mywebapp/, */mywebapp/* # path for app eg. localhost:8080/mywebapp/
  15. - EXTRA_SETTINGS=reqrep ^([^\ :]*)\ /mywebapp/(.*) \1\ /\2 # Optional: used to path rewrite
  16. networks: # Optional
  17. - mynet
  18. redis:
  19. image: redis
  20. expose:
  21. - "6379"
  22. volumes:
  23. - "redis-data:/data"
  24. command: redis-server --appendonly yes
  25. networks: # Optional
  26. - mynet
  27. lbapp:
  28. image: dockercloud/haproxy
  29. links:
  30. - webapp # Name of the backend service that you want to be load balanced
  31. volumes:
  32. - "/var/run/docker.sock:/var/run/docker.sock"
  33. ports:
  34. - "8080:80" # Map lb's port 80 to 8080 that can be used to accessed lb from outside
  35. networks: # Optional
  36. - mynet
  37. networks: # Optional
  38. mynet:
  39. volumes:
  40. redis-data:
Add Comment
Please, Sign In to add comment