As it has been discovered, regular update of postgresql cause issues when
the database gets restarted, cause the containers can no longer correctly
resolve the hostname and reconnect, therefore use ‹PartOf› to truly¹
force a restart of the container once the database gets restarted.
¹ Tried to fix a similar issue once already in 737acfd
, based on the
observations, I have failed…
Signed-off-by: Matej Focko <me@mfocko.xyz>
26 lines
466 B
Text
26 lines
466 B
Text
# {{ ansible_managed }}
|
|
|
|
[Unit]
|
|
Description=Vaultwarden
|
|
After=postgresql.service
|
|
Requires=postgresql.service
|
|
PartOf=postgresql.service
|
|
|
|
[Container]
|
|
ContainerName=vaultwarden
|
|
Image=ghcr.io/dani-garcia/vaultwarden:latest
|
|
AutoUpdate=registry
|
|
|
|
EnvironmentFile=/etc/vaultwarden.ini
|
|
|
|
Network=vaultwarden.network
|
|
PublishPort={{ vaultwarden_http_port }}:80
|
|
PublishPort=3012:3012
|
|
|
|
Volume=vaultwarden-data:/data
|
|
|
|
[Service]
|
|
Restart=always
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|