From 4f16bd46d9ea046abdee395cec32af06d87137f5 Mon Sep 17 00:00:00 2001 From: Brodin Date: Mon, 23 Sep 2024 21:25:54 -0400 Subject: [PATCH] first commit --- arr/docker-compose.yml | 4 +- dashboard/docker-compose.yml | 38 ------------ monitoring/.env.example | 7 +++ monitoring/.gitignore | 1 + monitoring/docker-compose.yml | 60 +++++++++++++++++++ sites/rittenhop/.env.example | 5 ++ sites/rittenhop/config.production.json | 30 ++++++++++ .../rittenhop/config.production.json.example | 30 ++++++++++ sites/rittenhop/docker-compose.yml | 40 +++++++++++++ sites/rittenhop/update.sh | 1 + stats/docker-compose.yml | 1 + 11 files changed, 177 insertions(+), 40 deletions(-) create mode 100644 monitoring/.env.example create mode 100644 monitoring/.gitignore create mode 100644 monitoring/docker-compose.yml create mode 100644 sites/rittenhop/.env.example create mode 100644 sites/rittenhop/config.production.json create mode 100644 sites/rittenhop/config.production.json.example create mode 100644 sites/rittenhop/docker-compose.yml create mode 100644 sites/rittenhop/update.sh diff --git a/arr/docker-compose.yml b/arr/docker-compose.yml index f7504dd..d6020cb 100644 --- a/arr/docker-compose.yml +++ b/arr/docker-compose.yml @@ -204,8 +204,8 @@ services: - TZ=Etc/UTC - DOCKER_MODS=linuxserver/mods:universal-calibre #optional - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional - - VIRTUAL_HOST=calibre-web.${DOMAIN} - - LETSENCRYPT_HOST=calibre-web.${DOMAIN} + - VIRTUAL_HOST=books.${DOMAIN} + - LETSENCRYPT_HOST=books.${DOMAIN} - LETSENCRYPT_EMAIL=${EMAIL} volumes: - ${CONFIG_LOCATION}/calibre-web:/config diff --git a/dashboard/docker-compose.yml b/dashboard/docker-compose.yml index 66d6a30..77717f5 100644 --- a/dashboard/docker-compose.yml +++ b/dashboard/docker-compose.yml @@ -34,44 +34,6 @@ services: - 3001:3001 volumes: - /:/mnt/host:ro - prometheus: - image: prom/prometheus - container_name: prometheus - user: '0' - command: - - '--config.file=/etc/prometheus/prometheus.yml' - ports: - - 9090:9090 - restart: unless-stopped - volumes: - - ${CONFIG_LOCATION}/prometheus:/etc/prometheus - - ${DATA_LOCATION}/prometheus:/prometheus - node_exporter: - image: quay.io/prometheus/node-exporter:latest - container_name: node_exporter - command: - - '--path.rootfs=/host' - ports: - - 9100:9100 - pid: host - restart: unless-stopped - volumes: - - '/:/host:ro,rslave' - grafana: - image: grafana/grafana-enterprise - container_name: grafana - restart: unless-stopped - user: '0' - environment: - - GF_SERVER_ROOT_URL=https://grafana.${DOMAIN} - - GF_INSTALL_PLUGINS=grafana-clock-panel - - VIRTUAL_HOST=grafana.${DOMAIN} - - LETSENCRYPT_HOST=grafana.${DOMAIN} - - LETSENCRYPT_EMAIL=${EMAIL} - volumes: - - ${CONFIG_LOCATION}/grafana:/var/lib/grafana - ports: - - '3003:3000' networks: default: name: nginx-proxy diff --git a/monitoring/.env.example b/monitoring/.env.example new file mode 100644 index 0000000..604cbf5 --- /dev/null +++ b/monitoring/.env.example @@ -0,0 +1,7 @@ +DOMAIN=example.com +UID=1000 +GID=1000 +TZ=Etc/UTC +CONFIG_LOCATION=./config +DATA_LOCATION=./data +EMAIL=example@mail.com diff --git a/monitoring/.gitignore b/monitoring/.gitignore new file mode 100644 index 0000000..adbb97d --- /dev/null +++ b/monitoring/.gitignore @@ -0,0 +1 @@ +data/ \ No newline at end of file diff --git a/monitoring/docker-compose.yml b/monitoring/docker-compose.yml new file mode 100644 index 0000000..62f88c9 --- /dev/null +++ b/monitoring/docker-compose.yml @@ -0,0 +1,60 @@ +services: + cadvisor: + image: gcr.io/cadvisor/cadvisor:latest + container_name: cadvisor + privileged: true + restart: unless-stopped + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + prometheus: + image: prom/prometheus + container_name: prometheus + user: '0' + command: + - '--config.file=/etc/prometheus/prometheus.yml' + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - ${CONFIG_LOCATION}/prometheus:/etc/prometheus + - ${DATA_LOCATION}/prometheus:/prometheus + node-exporter: + image: quay.io/prometheus/node-exporter:latest + container_name: node-exporter + command: + - '--path.rootfs=/host' + ports: + - 9100:9100 + pid: host + restart: unless-stopped + volumes: + - '/:/host:ro,rslave' + smartctl-exporter: + image: prometheuscommunity/smartctl-exporter + container_name: smartctl-exporter + privileged: true + user: root + ports: + - "9633:9633" + grafana: + image: grafana/grafana-enterprise + container_name: grafana + restart: unless-stopped + user: '0' + environment: + - GF_SERVER_ROOT_URL=https://grafana.${DOMAIN} + - GF_INSTALL_PLUGINS=grafana-clock-panel + - VIRTUAL_HOST=grafana.${DOMAIN} + - LETSENCRYPT_HOST=grafana.${DOMAIN} + - LETSENCRYPT_EMAIL=${EMAIL} + volumes: + - ${CONFIG_LOCATION}/grafana:/var/lib/grafana + ports: + - '3003:3000' +networks: + default: + name: nginx-proxy + external: true diff --git a/sites/rittenhop/.env.example b/sites/rittenhop/.env.example new file mode 100644 index 0000000..9efa7a2 --- /dev/null +++ b/sites/rittenhop/.env.example @@ -0,0 +1,5 @@ +DBPASS=rittenhop +EMAIL=example@rittenhop.org +TZ=America/New_York +SITE=rittenhop.org +PORT=2368 \ No newline at end of file diff --git a/sites/rittenhop/config.production.json b/sites/rittenhop/config.production.json new file mode 100644 index 0000000..5d4c3de --- /dev/null +++ b/sites/rittenhop/config.production.json @@ -0,0 +1,30 @@ +{ + "url": "http://localhost:2377", + "server": { + "port": 2377, + "host": "::" + }, + "mail": { + "transport": "SMTP", + "options": { + "service": "Mailgun", + "host": "smtp.mailgun.org", + "port": 587, + "secure": false, + "auth": { + "user": "", + "pass": "" + } + } + }, + "logging": { + "transports": [ + "file", + "stdout" + ] + }, + "process": "systemd", + "paths": { + "contentPath": "/var/lib/ghost/content" + } +} diff --git a/sites/rittenhop/config.production.json.example b/sites/rittenhop/config.production.json.example new file mode 100644 index 0000000..5d4c3de --- /dev/null +++ b/sites/rittenhop/config.production.json.example @@ -0,0 +1,30 @@ +{ + "url": "http://localhost:2377", + "server": { + "port": 2377, + "host": "::" + }, + "mail": { + "transport": "SMTP", + "options": { + "service": "Mailgun", + "host": "smtp.mailgun.org", + "port": 587, + "secure": false, + "auth": { + "user": "", + "pass": "" + } + } + }, + "logging": { + "transports": [ + "file", + "stdout" + ] + }, + "process": "systemd", + "paths": { + "contentPath": "/var/lib/ghost/content" + } +} diff --git a/sites/rittenhop/docker-compose.yml b/sites/rittenhop/docker-compose.yml new file mode 100644 index 0000000..b8ead67 --- /dev/null +++ b/sites/rittenhop/docker-compose.yml @@ -0,0 +1,40 @@ +services: + ghost: + image: ghost:5 + container_name: rittenhop-ghost + restart: always + ports: + - ${PORT}:2377 + expose: + - ${PORT} + environment: + # see https://ghost.org/docs/config/#configuration-options + database__client: mysql + database__connection__host: rittenhop-db + database__connection__user: root + database__connection__password: ${DBPASS} + database__connection__database: rittenhop + VIRTUAL_HOST: "${SITE}" + VIRTUAL_PORT: ${PORT} + LETSENCRYPT_HOST: "${SITE}" + LETSENCRYPT_EMAIL: ${EMAIL} + # url: http://0.0.0.0:${PORT} #Dev + url: "https://${SITE}" #Prod + # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired) + # NODE_ENV: development + volumes: + - ./content:/var/lib/ghost/content + # - ./themes:/var/lib/ghost/current/content/themes:rw + db: + image: mysql:8.0 + container_name: rittenhop-db + restart: always + environment: + MYSQL_DATABASE: rittenhop + MYSQL_ROOT_PASSWORD: ${DBPASS} + volumes: + - ./db:/var/lib/mysql +networks: + default: + name: nginx-proxy + external: true \ No newline at end of file diff --git a/sites/rittenhop/update.sh b/sites/rittenhop/update.sh new file mode 100644 index 0000000..b167a5a --- /dev/null +++ b/sites/rittenhop/update.sh @@ -0,0 +1 @@ +sudo docker cp config.production.json rittenhop-ghost:/var/lib/ghost/. \ No newline at end of file diff --git a/stats/docker-compose.yml b/stats/docker-compose.yml index 57b4f72..da11ba1 100644 --- a/stats/docker-compose.yml +++ b/stats/docker-compose.yml @@ -39,6 +39,7 @@ services: ports: - 4018:3000 environment: + JAVA_OPTS: "-Xmx1g" #-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/directory MB_DB_TYPE: postgres MB_DB_DBNAME: ${PGDATABASE:-postgres} MB_DB_PORT: 5432