daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest May 16th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top