Skip to content

Instantly share code, notes, and snippets.

@amircloner
Last active July 26, 2023 21:15
Show Gist options
  • Save amircloner/ab822b0105fa3ee5d47ae48019e9af8f to your computer and use it in GitHub Desktop.
Save amircloner/ab822b0105fa3ee5d47ae48019e9af8f to your computer and use it in GitHub Desktop.
#!/bin/bash
#curl -sSL https://gist.github.com/amircloner/ab822b0105fa3ee5d47ae48019e9af8f/raw | bash
apt-get -y update
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.gpg
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker.service
sudo systemctl enable docker.service
sudo systemctl start containerd.service
sudo systemctl enable containerd.service
docker --version
# Configure SWAP
sudo fallocate -l 512MB /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sudo free -h
# install vnStat
docker run -d \
--restart=unless-stopped \
--network=host \
-e HTTP_PORT=8685 \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
--name vnstat \
vergoh/vnstat
# install netdata
docker run -d --name=netdata \
-p 19999:19999 \
-v netdataconfig:/etc/netdata \
-v netdatalib:/var/lib/netdata \
-v netdatacache:/var/cache/netdata \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/os-release:/host/etc/os-release:ro \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdata
docker run -d \
--name watchtower \
--restart=unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /root/.docker/config.json:/config.json \
containrrr/watchtower -c \
--interval 300
# install google BBR
wget -N --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && bash bbr.sh
# deploy public-intra
docker login registry.emrooz.ir
docker run -d \
-p 80:80 \
--restart=unless-stopped \
--name=v2ray \
registry.emrooz.ir/public-intra:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment