Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
trader-payne authored Aug 3, 2022
0 parents commit 14378ef
Show file tree
Hide file tree
Showing 5 changed files with 319 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
233 changes: 233 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions shell
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions start
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[email protected] \
GRAFANA_HOST=grafana.sld.tld \
ADMIN_USER=your_user \
ADMIN_PASSWORD=your_password \
docker-compose up -d --remove-orphans --build $@

0 comments on commit 14378ef

Please sign in to comment.