Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#cloud-config
preserve_hostname: false
fqdn: blog.kalena.app
hostname: blog.kalena.app
package_update: true
package_upgrade: true
package_reboot_if_required: true
packages: ['docker.io', 'ntp','libcap2-bin']
resolv_conf:
domain: kalena.app
cc_timezone: Europe/Berlin
write_files:
- content: |
blog.kalena.app {
tls guillermo@cientifico.net
proxy / http://localhost:3001
}
path: /etc/Caddyfile
runcmd:
- docker run -d --name blog-kalena -p 127.0.0.1:3001:2368 -v /blog-content:/var/lib/ghost/content -e url=http://blog.kalena.app ghost:2-alpine
- wget -O caddy.tar.gz 'https://caddyserver.com/download/linux/amd64?license=personal&telemetry=on'
- tar xvzf caddy.tar.gz
- cp caddy /usr/local/bin
- chown root:root /usr/local/bin/caddy
- chmod 755 /usr/local/bin/caddy
- setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
- groupadd -g 33 www-data
- useradd -g www-data --no-user-group --home-dir /var/www --no-create-home --shell /usr/sbin/nologin --system --uid 33 www-data
- mkdir /etc/caddy
- chown -R root:root /etc/caddy
- mkdir /etc/ssl/caddy
- chown -R root:www-data /etc/ssl/caddy
- chmod 0770 /etc/ssl/caddy
- mv /etc/Caddyfile /etc/caddy/
- chown root:root /etc/caddy/Caddyfile
- chmod 644 /etc/caddy/Caddyfile
- mkdir /var/www
- chown www-data:www-data /var/www
- chmod 555 /var/www
- cp ./init/linux-systemd/caddy.service /etc/systemd/system/
- chown root:root /etc/systemd/system/caddy.service
- chmod 644 /etc/systemd/system/caddy.service
- systemctl daemon-reload
- systemctl start caddy.service
- systemctl enable caddy.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.