mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-16 00:45:18 +00:00
refactor: simplify StopGracePeriod handling in container specifications
- Updated the handling of StopGracePeriod in various database builders to streamline the condition check, improving code readability and maintainability.
This commit is contained in:
@@ -125,8 +125,7 @@ export const mechanizeDockerContainer = async (
|
|||||||
Image: image,
|
Image: image,
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(StopGracePeriod !== undefined &&
|
...(StopGracePeriod && { StopGracePeriod }),
|
||||||
StopGracePeriod !== null && { StopGracePeriod }),
|
|
||||||
...(command
|
...(command
|
||||||
? {
|
? {
|
||||||
Command: ["/bin/sh"],
|
Command: ["/bin/sh"],
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
|
|||||||
Image: dockerImage,
|
Image: dockerImage,
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(StopGracePeriod !== undefined &&
|
...(StopGracePeriod && { StopGracePeriod }),
|
||||||
StopGracePeriod !== null && { StopGracePeriod }),
|
|
||||||
...(command
|
...(command
|
||||||
? {
|
? {
|
||||||
Command: ["/bin/sh"],
|
Command: ["/bin/sh"],
|
||||||
|
|||||||
@@ -121,8 +121,7 @@ ${command ?? "wait $MONGOD_PID"}`;
|
|||||||
Image: dockerImage,
|
Image: dockerImage,
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(StopGracePeriod !== undefined &&
|
...(StopGracePeriod && { StopGracePeriod }),
|
||||||
StopGracePeriod !== null && { StopGracePeriod }),
|
|
||||||
...(replicaSets
|
...(replicaSets
|
||||||
? {
|
? {
|
||||||
Command: ["/bin/bash"],
|
Command: ["/bin/bash"],
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ export const buildMysql = async (mysql: MysqlNested) => {
|
|||||||
Image: dockerImage,
|
Image: dockerImage,
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(StopGracePeriod !== undefined &&
|
...(StopGracePeriod && { StopGracePeriod }),
|
||||||
StopGracePeriod !== null && { StopGracePeriod }),
|
|
||||||
...(command
|
...(command
|
||||||
? {
|
? {
|
||||||
Command: ["/bin/sh"],
|
Command: ["/bin/sh"],
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ export const buildPostgres = async (postgres: PostgresNested) => {
|
|||||||
Image: dockerImage,
|
Image: dockerImage,
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(StopGracePeriod !== undefined &&
|
...(StopGracePeriod && { StopGracePeriod }),
|
||||||
StopGracePeriod !== null && { StopGracePeriod }),
|
|
||||||
...(command
|
...(command
|
||||||
? {
|
? {
|
||||||
Command: ["/bin/sh"],
|
Command: ["/bin/sh"],
|
||||||
|
|||||||
@@ -70,8 +70,7 @@ export const buildRedis = async (redis: RedisNested) => {
|
|||||||
Image: dockerImage,
|
Image: dockerImage,
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(StopGracePeriod !== undefined &&
|
...(StopGracePeriod && { StopGracePeriod }),
|
||||||
StopGracePeriod !== null && { StopGracePeriod }),
|
|
||||||
Command: ["/bin/sh"],
|
Command: ["/bin/sh"],
|
||||||
Args: [
|
Args: [
|
||||||
"-c",
|
"-c",
|
||||||
|
|||||||
Reference in New Issue
Block a user