Skip to content

Instantly share code, notes, and snippets.

@fabiocruzcoelho
Created December 28, 2017 17:57
Show Gist options
  • Save fabiocruzcoelho/17cfbd49665ae228958e014e72f7b7ea to your computer and use it in GitHub Desktop.
Save fabiocruzcoelho/17cfbd49665ae228958e014e72f7b7ea to your computer and use it in GitHub Desktop.
version: "3.4"
volumes:
grafana-nfs:
driver: local
driver_opts:
type: nfs
o: addr=172.16.20.30,rw
device: ":/oslinux/grafana"
services:
grafana:
image: monitoringartist/grafana-xxl:latest
ports:
- "3000:3000"
networks:
- traefik-net
volumes:
- type: volume
source: grafana-nfs
target: /var/lib/grafana
volume:
nocopy: true
#volumes:
# - nfs:/oslinux/grafana:/var/lib/grafana
# service deployment
deploy:
mode: replicated
replicas: 1
labels:
- "traefik.port=3000"
- "traefik.backend=grafana"
- "traefik.docker.network=traefik-net"
- "traefik.frontend.rule=Host:grafana.braspress.com.br"
- "traefik.backend.loadbalancer.sticky=true"
# service resource management
resources:
# Hard limit - Docker does not allow to allocate more
limits:
cpus: '0.25'
memory: 512M
# Soft limit - Docker makes best effort to return to it
reservations:
cpus: '0.25'
memory: 256M
# service restart policy
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
# service update configuration
update_config:
parallelism: 2
delay: 10s
failure_action: continue
monitor: 60s
max_failure_ratio: 0.3
# placement constraint - in this case on 'worker' nodes only
placement:
constraints: [node.role == manager]
networks:
traefik-net:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment