PromucFlow_constructor/deploy/digital_ocean/scripts/01-packages.sh
2021-12-17 20:08:14 +05:30

23 lines
445 B
Bash

#!/bin/bash
# Add a swap file to prevent build time OOM errors
fallocate -l 8G /swapfile
mkswap /swapfile
swapon /swapfile
# update apt
apt-get -y update
apt-get -y upgrade
# install Digital Ocean agent
curl -sSL https://repos.insights.digitalocean.com/install.sh | bash
# open ports
echo "y" | ufw enable
ufw allow http
ufw allow https
ufw allow ssh
# Disable and remove the swapfile prior to snapshotting
swapoff /swapfile
rm -f /swapfile