# fuge configuration

# global configuration settings here affect behaviour of all managed processes
fuge_global: 

  # run docker containers at the specified phases (or false)
  run_containers: false

  # tail process output by default
  tail: true

  # monitor all process output by default
  monitor: true

  # exclude the following regular expression matches from monitoring
  monitor_excludes: 
    - /node_modules|\.git|\.log/mgi,


  # run internal dns server with the following settigs
  dns: true
  #dns_prefix: 
  dns_suffix: .internal.com

  # auto generate environment variables for simple service discovery
  auto_generate_environment: true 
  auto_port_start: 10000

  # global environment variables set in all processes
  envrionment:
    - FUGE=ROCKS    # global environment variables

  # delay before starting a process
  delay_start: 0

  # restart a process on error - overrideaable defaults to false
  restart_on_error: true
  maximum_restarts: 5
  

# services
frontend:
  type: process
  path: ../wibble
  repo:                    # https://... provide a repository to enable clone command to pull this for clean environments
  build: 'sh build.sh'     # to enable build all services
  test: 'npm test'         # to enable test all services
  run: 'npm start'         # to enable run all services
  delay_start: 0
  restart_on_error: true
  maximum_restarts: 5
  environment:
    - ONE=TWO              # environment for this process, overrides any global values
  ports:
    - http=10000           # if ports are set these will be used to auto generate <service>_<proto>_PORT environment values 
    - tcp=100001           # and / or dns srv resource records. If only one port is set fuge will also generate <service>_PORT variables

# containers - fuge will use the container settings to generate service discovery information for environment variables or dns. It will optionally
#              run these containers (assuming docker). 
mongo:
  type:container
  image: wibble                # the container image to pull and run
  run: 'docker run -e -p...'   # the docker run command to start the container
  environment:
    - ONE=TWO                  # environment for this container, overrides any global values
  ports:
    - http=10000:80            # if ports are set these will be used to auto generate <service>_<proto>_PORT environment values 
    - tcp=100001:1234          # and / or dns srv resource records. If only one port is set fuge will also generate <service>_PORT variables
                               # these will also be passed to the docker engine using a -p argument http=1000:80 => -p 10000:80

