Example of standalone Bun.js application deployment to Hetzner Cloud using Rootless Podman Quadlet systemd services. It can be used also as an simple alternative deployment method for Raspberry Pi.
The project shows an example deployment of a Bun.js (and possibly Node.js) application using Ansible to a Hetzner VPS.
The infrastructure consists of:
- Hetzner ARM CAX11 server (provision made by Ansible)
- NGINX and Letsencrypt
- Fish Shell
- Podman Quadlet containers that runs under deploy user with autoupdate containers
- Docker registry
Take a look at container file: https://github.com/Mati365/hetzner-podman-bunjs-deploy/blob/main/infra/roles/apps/frontend/tasks/main.yml
-
Create empty project on hetzner.com, add primary IP named
app-primary-ip
-
Point your DNS to
app-primary-ip
IPv4 address -
Set these envs:
HCLOUD_KEY: <your hcloud read & write key> REGISTRY_USERNAME: <specify username for podman registry> REGISTRY_PASSWORD: <specify password for podman registry> WEBSITE_DOMAIN: <specify site domain name without protocol e.g `example.site.org`>
-
Paste your public SSH keys to all users dirs present in
infra/keys/authorized/
-
Run
deploy-hetzner.yml
workflow bygit push origin main:hetzner
-
Enter your
Hello World
site and enjoy!
https://www.redhat.com/sysadmin/quadlet-podman
https://www.redhat.com/sysadmin/podman-auto-updates-rollbacks
https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html
MIT License
Copyright (c) 2023 Mateusz Bagiński
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.