refactor: streamline command and args handling in Redis container configuration

- Updated the Redis container build function to simplify the handling of command and arguments.
- Ensured default command and arguments are set when none are provided, improving robustness.
This commit is contained in:
Mauricio Siu
2025-11-30 12:18:47 -06:00
parent 272a8dbdb2
commit c1d23b18fb
+14 -8
View File
@@ -73,14 +73,20 @@ export const buildRedis = async (redis: RedisNested) => {
Mounts: [...volumesMount, ...bindsMount, ...filesMount], Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(StopGracePeriod !== null && ...(StopGracePeriod !== null &&
StopGracePeriod !== undefined && { StopGracePeriod }), StopGracePeriod !== undefined && { StopGracePeriod }),
...(command && { ...(command || args
Command: command.split(" "), ? {
}), ...(command && {
...(args && Command: command.split(" "),
args.length > 0 && { }),
Args: args, ...(args &&
}), args.length > 0 && {
Args: args,
}),
}
: {
Command: ["/bin/sh"],
Args: ["-c", `redis-server --requirepass ${databasePassword}`],
}),
Labels, Labels,
}, },
Networks, Networks,