---

jupyter: # pw: letscode.00
  host:
    himbeere:
      fqdn: code.cere.duckdns.org
      docker:
        build: jupyter
        ports: 17888:80
        volumes:
          - /mnt/ssdext/data/jupyter/notebooks:/root/notebooks
          - /mnt/ssdext/data/jupyter/config:/root/.local
          - /mnt/ssdext/data/jupyter/config_root:/root/.jupyter

    #~ blaubeere:
      #~ docker:
        #~ build: jupyter
        #~ ports: 17888:8888
        #~ volumes:
          #~ - /opt/jupyter/notebooks:/root/notebooks
          #~ - /opt/jupyter/config:/root/.local
          #~ - /opt/jupyter/config_root:/root/.jupyter
  docker:
    build: jupyter


domoticz:
  host: himbeere
  fqdn: domo.cere.duckdns.org
  docker:
    build: domoticz
    image: domoticz
    volumes:
      - /etc/localtime:/etc/localtime
      - /mnt/ssdext/data/domoticz/domoticz.db:/root/domoticz/domoticz.db
    # ports: 8080:8080
    devices: /dev/ttyUSB0

netdata:
  host: himbeere
  #~ fqdn: netdata.cere.duckdns.org
  docker:
    hostname: himbeere
    build: netdata
    # image: reneluria/netdata
    cap_add: SYS_PTRACE
    volumes:
    - /proc:/host/proc:ro
    - /sys:/host/sys:ro
    - /var/run/docker.sock:/var/run/docker.sock
    ports: 0.0.0.0:19999:19999

# https://github.com/mkueper/rpi-svn
svn:
  host: himbeere
  docker:
    build: svn
    volumes:
      - /mnt/ssdext/data/svn:/var/svn
    ports: 3690:3690
    stop_signal: SIGKILL

ngp: # nginx proxy with lets encrypt
  host: himbeere
  docker:
    - name: nginx-proxy
      build: ngp
      ports: 192.168.178.43:1080:80, 192.168.178.43:1443:443
      volumes:
        - /usr/share/nginx/html
        - /mnt/ssdext/data/nginx/htpasswd:/etc/nginx/htpasswd \
        - /var/run/docker.sock:/tmp/docker.sock:ro
        - /mnt/ssdext/data/nginx/certs:/etc/nginx/certs:ro
        # see https://github.com/jwilder/nginx-proxy#per-virtual_host
        - /mnt/ssdext/data/nginx/vhost.d:/etc/nginx/vhost.d:ro
      labels:
        com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
      commands:
        nginx_conf:
          method: exec
          cmd: cat /etc/nginx/conf.d/default.conf
          docs: show dockergen-generated config

    - name: ngp_le
      build: ngp_le
      volumes_from: nginx-proxy
      volumes:
        - /mnt/ssdext/data/nginx/certs:/etc/nginx/certs:rw
        - /var/run/docker.sock:/var/run/docker.sock:ro
        - /mnt/ssdext/data/nginx/vhost.d:/etc/nginx/vhost.d:rw

#~ nexus:
  #~ host: himbeere
  #~ docker:
    #~ build: nexus
    #~ volumes:
      #~ - /etc/localtime:/etc/localtime
      #~ - /mnt/ssdext/data/nexus:/opt/sonatype-work
    #~ ports: 1381:8081

#~ pypy:
  #~ host: himbeere
  #~ docker:
    #~ build: pypy
    #~ volumes:
      #~ - /etc/localtime:/etc/localtime
piusv:
  host: himbeere
  docker:
    build: piusv
    devices: /dev/i2c-1
    # S.USV Daemon started..
    # Kann nicht auf export schreiben!
    # : Read-only file system
    privileged: true
    volumes: /mnt/ssdext/data/piusv/log:/var/log/

  commands:
    # Zwei I²C-Adressen sind im Einsatz – 0x0F für die S.USV und 0x68 für die Real Time Clock,
    # die sich auf der S.USV befindet
    i2cdetect: i2cdetect -y 1
    # Der S.USV Daemon erstellt ein Protokoll in der Datei: /var/log/susvd.log
    usv_logs: tail -f -n 100 /var/log/susvd.log

rsync:
  host: himbeere
  docker:
    build: rsync
    volumes:
      - /etc/localtime:/etc/localtime
      - /mnt/ssdext/data:/opt/from
      - /mnt/hddext/backup:/opt/to
    restart_policy:
      always: 3



gogs: # git server with wiki
  host: himbeere
  fqdn: git.cere.duckdns.org
  docker:
    image: gogs/gogs-rpi
    volumes: /mnt/ssdext/data/gogs:/data
    ports: 3022:22
    env:
      VIRTUAL_PORT: 3000
    healthcheck:
      test: curl -I --silent http://localhost:3000 | grep "404 Not Found"
      interval: 10 # seconds

graphite:
  host: himbeere
  docker:
    build: graphite
    #~ image: abarbanell/docker-grafana-graphite
    volumes:
      - /mnt/ssdext/data/graphite/whisper:/opt/graphite/storage/whisper
      - /mnt/ssdext/data/graphite/logs:/var/log/supervisor
    ports:
      - 13080:8000
      - 8125:8125/udp
      - 8126:8126

alexa: # https://alexa.amazon.de
  fqdn: alexa.cere.duckdns.org
  host: himbeere
  docker:
    build: alexa
    env:
      DOMO_ALEXA_PW: ibm92buVQ12nhipkP4fg

matrix: # interface with RGB LED-Matrix
  #~ fqdn: alexa.cere.duckdns.org
  host: blaubeere
  docker:
    build: matrix
    # matrix driver needs access to /dev/mem
    privileged: true
    ports: 17888:8888, 10000:10000/udp, 10001:10001/udp
    volumes:
      - /opt/jupyter/notebooks:/root/notebooks
      - /opt/jupyter/config:/root/.local
      - /opt/jupyter/config_root:/root/.jupyter
      - /opt/jupyter/config_ipy_root:/root/.ipython
      - /opt/pixel:/pixel

  commands:
    # some rotating square
    demo00: examples-api-use/demo -c 4 --led-show-refresh -D0
    # forward scrolling an image
    demo01: examples-api-use/demo -c 4 --led-show-refresh -D1 examples-api-use/runtext.ppm
    # test image
    demo03: examples-api-use/demo -c 4 -D3
    # Abelian sandpile model (-m <time-step-ms>)
    demo06: examples-api-use/demo -c 4 -D6
    # Conway's game of life (-m <time-step-ms>)
    demo07: /bin/bash -c "while true; do examples-api-use/demo -c 4 -b 20 -D7 -t 15; done"
    # Langton's ant (-m <time-step-ms>)
    demo08: examples-api-use/demo -c 4 -m 1  --led-show-refresh -D8
    # Volume bars
    demo09: examples-api-use/demo -c 4 -D9
    # Evolution of color
    demo10: examples-api-use/demo -c 4 -D10
    # Brightness pulse generator
    demo11: examples-api-use/demo -c 4 --led-pwm-bits=11 -D11
    # python sample: rotatatin block
    pydemo1: bindings/python/samples/rotating-block-generator.py -c 4 --led-show-refresh
    # python sample: like demo01
    pydemo2: bindings/python/samples/image-scroller.py -c 4 --led-show-refresh -i examples-api-use/runtext.ppm
    # python sample: rotatatin block
    pydemo3: bindings/python/samples/simple-square.py -c 4 --led-show-refresh
    # tail logs of pixelreceiver (udp server)
    pixel_logs: tail -f /pixel/receive.log

vaping:
  host: erdbeere
  docker:
    build: vaping
    ports: 6080:7021


