feat: Add cloud-init file
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-14 13:02:21 -04:00
parent 1c4abcf12f
commit c92a0d0703
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# cloud-init
This folder contains cloud-init files for installing Abra and its dependencies.
For more information, see <https://cloudinit.readthedocs.io/en/latest/index.html>

View File

@ -0,0 +1,49 @@
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: true
# https://packages.debian.org/bookworm/docker.io
packages:
- ca-certificates
- curl
- docker.io
- docker-compose
# https://stackoverflow.com/a/74084180
- apparmor
# https://docs.coopcloud.tech/operators/tutorial/#server-setup
runcmd:
- curl -fsSL https://install.abra.coopcloud.tech | env HOME=/root bash
- docker swarm init
- docker network create -d overlay proxy
write_files:
# Add abra to PATH and set EDITOR
- path: /etc/profile.d/custom_path.sh
content: |
export PATH=$PATH:$HOME/.local/bin
export EDITOR=vim
owner: root:root
permissions: '0755'
# Send container log to journald: https://docs.coopcloud.tech/operators/handbook/#how-do-i-persist-container-logs-after-they-go-away
- path: /etc/docker/daemon.json
content: |
{
"log-driver": "journald",
"log-opts": {
"labels":"com.docker.swarm.service.name"
}
}
owner: root:root
permissions: '0644'
# Rotate logs
- path: /etc/systemd/journald.conf
content: |
[Journal]
Storage=persistent
SystemMaxUse=5G
MaxFileSec=1month
owner: root:root
permissions: '0644'