fix: apply stop grace period within container spec

This commit is contained in:
Lucas Manchine
2025-11-20 16:15:52 -03:00
parent a5abd46386
commit 1c652477fb
7 changed files with 24 additions and 16 deletions

View File

@@ -73,6 +73,8 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
Image: dockerImage,
Env: envVariables,
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
...(command
? {
Command: ["/bin/sh"],
@@ -106,8 +108,6 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
: [],
},
UpdateConfig,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
};
try {
const service = docker.getService(appName);

View File

@@ -121,6 +121,8 @@ ${command ?? "wait $MONGOD_PID"}`;
Image: dockerImage,
Env: envVariables,
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
...(replicaSets
? {
Command: ["/bin/bash"],
@@ -159,8 +161,6 @@ ${command ?? "wait $MONGOD_PID"}`;
: [],
},
UpdateConfig,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
};
try {

View File

@@ -79,6 +79,8 @@ export const buildMysql = async (mysql: MysqlNested) => {
Image: dockerImage,
Env: envVariables,
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
...(command
? {
Command: ["/bin/sh"],
@@ -112,8 +114,6 @@ export const buildMysql = async (mysql: MysqlNested) => {
: [],
},
UpdateConfig,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
};
try {
const service = docker.getService(appName);

View File

@@ -72,6 +72,8 @@ export const buildPostgres = async (postgres: PostgresNested) => {
Image: dockerImage,
Env: envVariables,
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
...(command
? {
Command: ["/bin/sh"],
@@ -105,8 +107,6 @@ export const buildPostgres = async (postgres: PostgresNested) => {
: [],
},
UpdateConfig,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
};
try {
const service = docker.getService(appName);

View File

@@ -70,6 +70,8 @@ export const buildRedis = async (redis: RedisNested) => {
Image: dockerImage,
Env: envVariables,
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
Command: ["/bin/sh"],
Args: [
"-c",
@@ -102,8 +104,6 @@ export const buildRedis = async (redis: RedisNested) => {
: [],
},
UpdateConfig,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),
};
try {