nextcloud: Pull the image separately before starting systemd unit

This prevents timeout of the service if the image pull is slow.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-04-14 17:42:47 -07:00 committed by James Valleroy
parent 6e2db19a26
commit 035d3b49bf
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -505,6 +505,10 @@ def podman_create(container_name: str, image_name: str, volume_name: str,
directory = pathlib.Path('/etc/containers/systemd')
directory.mkdir(parents=True, exist_ok=True)
# Fetch the image before creating the container. The systemd service for
# the container won't timeout due to slow internet connectivity.
subprocess.run(['podman', 'image', 'pull', image_name], check=True)
pathlib.Path(volume_path).mkdir(parents=True, exist_ok=True)
# Create storage volume
volume_file = directory / f'{volume_name}.volume'