Added command

This commit is contained in:
Maurice
2025-07-23 18:23:09 +02:00
parent 401ab5f016
commit 3d600026c5
3 changed files with 6 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ depend = ["nc-test-database"]
restart = "unless-stopped" restart = "unless-stopped"
detach = true detach = true
hostname = "nc-test-api-hn" hostname = "nc-test-api-hn"
command = "dotnet NumberChords.Api.dll"
[service.healthcheck] [service.healthcheck]
cmd = "pg_isready --dbname=$DB_DATABASE_NAME --username=$DB_USERNAME || exit 1" cmd = "pg_isready --dbname=$DB_DATABASE_NAME --username=$DB_USERNAME || exit 1"

View File

@@ -94,6 +94,10 @@ pub fn generate_openrc(config: &ServiceConfig) {
arguments.push(config.service.image.clone()); 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() script.push_str(&wrap(&format!("podman run {}", arguments.iter()
.enumerate() .enumerate()
.map(|(i, arg)| if i > 0 { format!("\t{}", arg) } else { arg.to_string() }) .map(|(i, arg)| if i > 0 { format!("\t{}", arg) } else { arg.to_string() })

View File

@@ -36,6 +36,7 @@ pub struct Service {
pub restart: Option<String>, pub restart: Option<String>,
pub detach: Option<bool>, pub detach: Option<bool>,
pub healthcheck: Option<HealthCheck>, pub healthcheck: Option<HealthCheck>,
pub command: Option<String>,
#[serde(default)] #[serde(default)]
pub depend: Vec<String>, pub depend: Vec<String>,