From 3d600026c56908644d8d0a08d96b986fa7ec0b06 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 23 Jul 2025 18:23:09 +0200 Subject: [PATCH] Added command --- example.toml | 1 + src/main.rs | 4 ++++ src/service.rs | 1 + 3 files changed, 6 insertions(+) diff --git a/example.toml b/example.toml index b47d38c..86d9563 100644 --- a/example.toml +++ b/example.toml @@ -8,6 +8,7 @@ depend = ["nc-test-database"] restart = "unless-stopped" detach = true hostname = "nc-test-api-hn" +command = "dotnet NumberChords.Api.dll" [service.healthcheck] cmd = "pg_isready --dbname=$DB_DATABASE_NAME --username=$DB_USERNAME || exit 1" diff --git a/src/main.rs b/src/main.rs index 99af376..0d04410 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,6 +94,10 @@ pub fn generate_openrc(config: &ServiceConfig) { arguments.push(config.service.image.clone()); + if let Some(command) = &config.service.command { + arguments.push(command.clone()); + } + script.push_str(&wrap(&format!("podman run {}", arguments.iter() .enumerate() .map(|(i, arg)| if i > 0 { format!("\t{}", arg) } else { arg.to_string() }) diff --git a/src/service.rs b/src/service.rs index f18c1b9..d6b8f79 100644 --- a/src/service.rs +++ b/src/service.rs @@ -36,6 +36,7 @@ pub struct Service { pub restart: Option, pub detach: Option, pub healthcheck: Option, + pub command: Option, #[serde(default)] pub depend: Vec,