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
+7 -1
View File
@@ -73,6 +73,8 @@ 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 || args
? {
...(command && { ...(command && {
Command: command.split(" "), Command: command.split(" "),
}), }),
@@ -80,7 +82,11 @@ export const buildRedis = async (redis: RedisNested) => {
args.length > 0 && { args.length > 0 && {
Args: args, Args: args,
}), }),
}
: {
Command: ["/bin/sh"],
Args: ["-c", `redis-server --requirepass ${databasePassword}`],
}),
Labels, Labels,
}, },
Networks, Networks,