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
|
2023-11-30 07:27:51 +01:00
|
|
|
docker compose build --pull
|
2023-02-22 09:54:38 +01:00
|
|
|
docker compose pull
|
2023-11-30 07:27:51 +01:00
|
|
|
docker compose up --detach --force-recreate --build
|
2023-02-22 09:54:38 +01:00
|
|
|
docker image prune -f
|
2023-11-30 07:27:51 +01:00
|
|
|
docker system prune -f
|
2023-02-22 09:54:38 +01:00
|
|
|
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
|