vm-setup/debian.sh

37 lines
674 B
Bash
Raw Normal View History

2023-02-22 09:54:38 +01:00
#!/bin/bash
cd /root
#updates
apt update && apt upgrade -y
apt install -y unattended-upgrades apt-config-auto-update
#update script
cat >> update.sh << 'END'
#!/bin/bash
cd /root
docker compose pull
2023-02-22 10:03:38 +01:00
docker compose up --detach --force-recreate
2023-02-22 09:54:38 +01:00
docker image prune -f
END
chmod +x update.sh
ln -s /root/update.sh /etc/cron.weekly/update_docker
2023-02-22 09:57:59 +01:00
2023-02-22 10:01:59 +01:00
touch docker-compose.yml
2023-02-22 09:57:59 +01:00
#docker
apt install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh
2023-10-10 19:54:11 +02:00
rm get-docker.sh
2023-04-23 15:29:35 +02:00
#autoheal
docker run -d \
--name autoheal \
--restart=always \
-e AUTOHEAL_CONTAINER_LABEL=all \
-v /var/run/docker.sock:/var/run/docker.sock \
willfarrell/autoheal