From 14378efebfd824106196d7fa4ce6d5e6f4c69b41 Mon Sep 17 00:00:00 2001 From: Trader_Payne Date: Wed, 3 Aug 2022 19:41:39 +0300 Subject: [PATCH] Initial commit --- .gitattributes | 63 ++++++++++++ .gitignore | 11 +++ docker-compose.yml | 233 +++++++++++++++++++++++++++++++++++++++++++++ shell | 7 ++ start | 5 + 5 files changed, 319 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 shell create mode 100644 start diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8b00408 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text eol=lf + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +*.jpg binary +*.png binary +*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f545555 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*DS_Store +.vs/ +.vscode/ +.idea/ +start +.obsidian/app.json +.obsidian/appearance.json +.obsidian/core-plugins.json +.obsidian/hotkeys.json +.obsidian/workspace +offchain-subgraphs diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7f1174f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,233 @@ +version: '3.7' + +x-logging: + &default-logging + options: + max-file: '1' + compress: 'false' + driver: local + +networks: + monitor-net: + driver: bridge + +volumes: + prometheus_data: {} + grafana_data: {} + nginx_certs: {} + nginx_vhost: {} + nginx_html: {} + nginx_acme: {} + +services: + + +###################################################################################### +##################### NGINX PROXY CONTAINER ####################### +###################################################################################### + + + + nginx-proxy: + image: jwilder/nginx-proxy + container_name: nginx-proxy + ports: + - "80:80" + - "443:443" + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - nginx_certs:/etc/nginx/certs + - nginx_vhost:/etc/nginx/vhost.d + - nginx_html:/usr/share/nginx/html + - ./nginx-proxy/nginx.conf:/etc/nginx/nginx.conf:ro + networks: + - monitor-net + restart: unless-stopped + logging: *default-logging + + +###################################################################################### +##################### NGINX SSL CONTAINER ####################### +###################################################################################### + + + nginx-ssl: + image: jrcs/letsencrypt-nginx-proxy-companion + container_name: nginx-ssl + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - nginx_certs:/etc/nginx/certs + - nginx_vhost:/etc/nginx/vhost.d + - nginx_html:/usr/share/nginx/html + - nginx_acme:/etc/acme.sh + restart: unless-stopped + networks: + - monitor-net + restart: unless-stopped + environment: + NGINX_PROXY_CONTAINER: nginx-proxy + DEFAULT_EMAIL: ${EMAIL} + logging: *default-logging + + + + + +###################################################################################### +##################### PROMETHEUS CONTAINER ####################### +###################################################################################### + + + + prometheus: + image: prom/prometheus + container_name: prometheus + volumes: + - ./prometheus:/etc/prometheus + - prometheus_data:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/etc/prometheus/console_libraries' + - '--web.console.templates=/etc/prometheus/consoles' + - '--storage.tsdb.retention.time=200h' + - '--web.enable-lifecycle' + restart: unless-stopped + expose: + - 9090 + networks: + - monitor-net + labels: + org.label-schema.group: "monitoring" + logging: *default-logging + + + +###################################################################################### +##################### ALERT MANAGER CONTAINER ####################### +###################################################################################### + + + + alertmanager: + image: prom/alertmanager + container_name: alertmanager + volumes: + - ./alertmanager:/etc/alertmanager + command: + - '--config.file=/etc/alertmanager/config.yml' + - '--storage.path=/alertmanager' + restart: unless-stopped + expose: + - 9093 + networks: + - monitor-net + labels: + org.label-schema.group: "monitoring" + logging: *default-logging + + + +###################################################################################### +##################### NODE EXPORTER CONTAINER ####################### +###################################################################################### + + + + nodeexporter: + image: prom/node-exporter + container_name: nodeexporter + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro + command: + - '--path.procfs=/host/proc' + - '--path.rootfs=/rootfs' + - '--path.sysfs=/host/sys' + - '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)' + restart: unless-stopped + expose: + - 9100 + networks: + - monitor-net + labels: + org.label-schema.group: "monitoring" + logging: *default-logging + + + +###################################################################################### +##################### CADVISOR CONTAINER ####################### +###################################################################################### + + + + cadvisor: + image: gcr.io/cadvisor/cadvisor + container_name: cadvisor + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker:/var/lib/docker:ro + - /cgroup:/cgroup:ro #doesn't work on MacOS only for Linux + restart: unless-stopped + expose: + - 8080 + networks: + - monitor-net + labels: + org.label-schema.group: "monitoring" + logging: *default-logging + + + +###################################################################################### +##################### GRAFANA CONTAINER ####################### +###################################################################################### + + + + grafana: + image: grafana/grafana + container_name: grafana + volumes: + - grafana_data:/var/lib/grafana + - ./grafana/provisioning:/etc/grafana/provisioning + environment: + - GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin} + - GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin} + - GF_USERS_ALLOW_SIGN_UP=false + - GF_SECURITY_DISABLE_BRUTE_FORCE_LOGIN_PROTECTION=true + - VIRTUAL_HOST=${GRAFANA_HOST} + - VIRTUAL_PORT=3000 + - LETSENCRYPT_HOST=${GRAFANA_HOST} + restart: unless-stopped + expose: + - 3000 + networks: + - monitor-net + labels: + org.label-schema.group: "monitoring" + logging: *default-logging + + + +###################################################################################### +##################### PUSHGATEWAY CONTAINER ####################### +###################################################################################### + + + + pushgateway: + image: prom/pushgateway + container_name: pushgateway + restart: unless-stopped + expose: + - 9091 + networks: + - monitor-net + labels: + org.label-schema.group: "monitoring" + logging: *default-logging diff --git a/shell b/shell new file mode 100644 index 0000000..5dabe57 --- /dev/null +++ b/shell @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -eEuo pipefail + +cd "$(dirname "${0}")/.." +# shellcheck source=/dev/null +# source ./.env.local +docker exec -it "${1}" "${2:-/bin/bash}" || true diff --git a/start b/start new file mode 100644 index 0000000..2ebcb7e --- /dev/null +++ b/start @@ -0,0 +1,5 @@ +EMAIL=email@domain.com \ +GRAFANA_HOST=grafana.sld.tld \ +ADMIN_USER=your_user \ +ADMIN_PASSWORD=your_password \ +docker-compose up -d --remove-orphans --build $@