version: '3'
services:
  sitespeed.io:
    image: sitespeedio/sitespeed.io
    command: -V
    shm_size: 1g
    volumes:
      - ./sitespeed-result/:/sitespeed.io/sitespeed-result
      - ./:/sitespeed.io
  grafana: # TODO: Grafana and graphite setup to be tested
    image: grafana/grafana:5.4.2
    depends_on:
      - graphite
    links:
      - graphite
    ports:
      - '3000:3000'
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=hdeAga76VG6ga7plZ1
      - GF_SECURITY_ADMIN_USER=sitespeedio
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_USERS_ALLOW_SIGN_UP=false
      - GF_USERS_ALLOW_ORG_CREATE=false
    volumes:
      - grafana:/var/lib/grafana
    restart: always
  graphite:
    image: sitespeedio/graphite:1.1.5-3
    ports:
      - '2003:2003'
      - '8080:80'
    restart: always
    volumes:
      # In production you should configure/map these to your container
      # Make sure whisper and graphite.db/grafana.db lives outside your containerr
      # https://www.sitespeed.io/documentation/sitespeed.io/graphite/#graphite-for-production-important
      - whisper:/opt/graphite/storage/whisper
      # Download an empty graphite.db from https://github.com/sitespeedio/sitespeed.io/tree/master/docker/graphite
      #- ./graphite/graphite.db:/opt/graphite/storage/graphite.db
      #- ./graphite/conf/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf
      #- ./graphite/conf/storage-aggregation.conf:/opt/graphite/conf/storage-aggregation.conf
      #- ./graphite/conf/carbon.conf:/opt/graphite/conf/carbon.conf
  grafana-setup:
    image: sitespeedio/grafana-bootstrap:8.0
    links:
      - grafana
    environment:
      - GF_PASSWORD=hdeAga76VG6ga7plZ1
      - GF_USER=sitespeedio
volumes:
  grafana:
  whisper:
