[Unit] Description = SFTP Key Initialisation Wants=network-online.target After=network-online.target [Container] ContainerName = sftp_init_keys Image = localhost/sftp:latest Volume = ssh_keys.volume:/data/ssh_keys:z Entrypoint = /bin/sh Exec = -c "[ -f /data/ssh_keys/ssh_host_ed25519_key ] || ssh-keygen -N '' -f /data/ssh_keys/ssh_host_ed25519_key -t ed25519" [Service] WorkingDirectory=/var/roothome/sftp ExecStartPre=podman build -t sftp:latest . Restart=on-failure [Install] WantedBy=multi-user.target