first commit
This commit is contained in:
+1002
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Environment variables with flags
|
||||
NODE_EXPORTER="${NODE_EXPORTER:-0}"
|
||||
|
||||
while getopts ":e:" opt; do
|
||||
case $opt in
|
||||
e) NODE_EXPORTER="1";;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
:)
|
||||
echo "Option -$OPTARG requires an argument." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
||||
apt update
|
||||
apt upgrade -y
|
||||
|
||||
# Docker installation
|
||||
# Add Docker's official GPG key:
|
||||
apt install ca-certificates curl -y
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||
chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
# Add the repository to Apt sources:
|
||||
tee /etc/apt/sources.list.d/docker.sources <<EOF
|
||||
Types: deb
|
||||
URIs: https://download.docker.com/linux/debian
|
||||
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
|
||||
Components: stable
|
||||
Signed-By: /etc/apt/keyrings/docker.asc
|
||||
EOF
|
||||
|
||||
apt update
|
||||
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
systemctl start docker
|
||||
docker run hello-world
|
||||
|
||||
# New Proxymanager folder
|
||||
|
||||
cp -r proxymanager /opt/
|
||||
|
||||
# other programs
|
||||
|
||||
apt install jq -y
|
||||
|
||||
|
||||
if [ "$NODE_EXPORTER" == "1" ]
|
||||
then
|
||||
bash prometheus-nodeExporter.sh
|
||||
fi
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd ~/node_exporter-1.10.2.linux-amd64
|
||||
./node_exporter
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
cp prometheus-export.sh ~/prometheus-export.sh
|
||||
cd ~
|
||||
wget https://github.com/prometheus/node_exporter/releases/download/v1.10.2/node_exporter-1.10.2.linux-amd64.tar.gz
|
||||
tar xvfz node_exporter-1.10.2.linux-amd64.tar.gz
|
||||
mv prometheus-export.sh node_exporter-1.10.2.linux-amd64/prometheus-export.sh
|
||||
rm node_exporter-1.10.2.linux-amd64.tar.gz
|
||||
cd node_exporter-1.10.2.linux-amd64
|
||||
(crontab -l 2>/dev/null; echo "*/5 * * * * ~/prometheus-export.sh") | crontab -
|
||||
./node_exporter
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
PG_PASS = SuperSecretPassword
|
||||
PG_USER = npm
|
||||
@@ -0,0 +1,37 @@
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
restart: unless-stopped
|
||||
container_name: npm
|
||||
ports:
|
||||
# These ports are in format <host-port>:<container-port>
|
||||
- '80:80' # Public HTTP Port
|
||||
- '443:443' # Public HTTPS Port
|
||||
- '81:81' # Admin Web Port
|
||||
# Add any other Stream port you want to expose
|
||||
# - '21:21' # FTP
|
||||
environment:
|
||||
TZ: "Europe/Berlin"
|
||||
# Postgres parameters:
|
||||
DB_POSTGRES_HOST: 'db'
|
||||
DB_POSTGRES_PORT: '5432'
|
||||
DB_POSTGRES_USER: ${PG_USER:-npm}
|
||||
DB_POSTGRES_PASSWORD: ${PG_PASS}
|
||||
DB_POSTGRES_NAME: 'npm'
|
||||
# Uncomment this if IPv6 is not enabled on your host
|
||||
# DISABLE_IPV6: 'true'
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./letsencrypt:/etc/letsencrypt
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgres:17
|
||||
container_name: npm-db
|
||||
environment:
|
||||
POSTGRES_USER: ${PG_USER:-npm}
|
||||
POSTGRES_PASSWORD: ${PG_PASS}
|
||||
POSTGRES_DB: 'npm'
|
||||
volumes:
|
||||
- ./postgresql:/var/lib/postgresql
|
||||
Reference in New Issue
Block a user