bitb0x/roles/apps/templates/bitcoin/bitcoin-node.container.j2
2025-04-10 06:42:41 -05:00

30 lines
842 B
Django/Jinja

[Unit]
Description=Bitcoin Node
Before=electrs-node.service clightning-node.service rtl-node.service
[Container]
# Use the centos image
Image={{ registry_url }}/bitcoin:{{ bitcoin_version }}
PodmanArgs=--pod bitcoin-pod
Environment=RPCAUTH={{ bitcoin_rpcauth }}
# Use volume
Volume=/home/{{ansible_user}}/vol/bitcoin/.bitcoin:/bitcoin/.bitcoin:Z
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
TimeoutStopSec=300
HealthCmd=/bin/sh -c "bitcoin-cli getblockchaininfo || exit 1"
HealthInterval=180s
HealthRetries=5
HealthStartPeriod=1000s
# ExecStartPre flag and other systemd commands can go here, see systemd.unit(5) man page.
# ExecStartPre=/usr/share/mincontainer/setup.sh
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target