mirror of
https://github.com/dokploy/dokploy.git
synced 2026-06-13 19:09:49 +00:00
fix: use stop-first update order for all database services (#4560)
Docker Swarm's default start-first update order causes new database containers to fail with 'DBPathInUse' because two containers compete for the same data volume simultaneously. Docker then rolls back the update, silently reverting any env var or config changes. Using stop-first ensures the old container is stopped before the new one starts, preventing volume lock conflicts across all database types. Fixes #4550
This commit is contained in:
@@ -140,7 +140,11 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
||||
: []),
|
||||
],
|
||||
},
|
||||
UpdateConfig,
|
||||
UpdateConfig: libsql.updateConfigSwarm ?? {
|
||||
Parallelism: 1,
|
||||
Order: "stop-first" as const,
|
||||
FailureAction: "rollback" as const,
|
||||
},
|
||||
};
|
||||
try {
|
||||
const service = docker.getService(appName);
|
||||
|
||||
@@ -111,7 +111,11 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
UpdateConfig: mariadb.updateConfigSwarm ?? {
|
||||
Parallelism: 1,
|
||||
Order: "stop-first" as const,
|
||||
FailureAction: "rollback" as const,
|
||||
},
|
||||
};
|
||||
try {
|
||||
const service = docker.getService(appName);
|
||||
|
||||
@@ -167,7 +167,11 @@ ${command ?? "wait $MONGOD_PID"}`;
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
UpdateConfig: mongo.updateConfigSwarm ?? {
|
||||
Parallelism: 1,
|
||||
Order: "stop-first" as const,
|
||||
FailureAction: "rollback" as const,
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
@@ -117,7 +117,11 @@ export const buildMysql = async (mysql: MysqlNested) => {
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
UpdateConfig: mysql.updateConfigSwarm ?? {
|
||||
Parallelism: 1,
|
||||
Order: "stop-first" as const,
|
||||
FailureAction: "rollback" as const,
|
||||
},
|
||||
};
|
||||
try {
|
||||
const service = docker.getService(appName);
|
||||
|
||||
@@ -109,7 +109,11 @@ export const buildPostgres = async (postgres: PostgresNested) => {
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
UpdateConfig: postgres.updateConfigSwarm ?? {
|
||||
Parallelism: 1,
|
||||
Order: "stop-first" as const,
|
||||
FailureAction: "rollback" as const,
|
||||
},
|
||||
};
|
||||
try {
|
||||
const service = docker.getService(appName);
|
||||
|
||||
@@ -115,7 +115,11 @@ export const buildRedis = async (redis: RedisNested) => {
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
UpdateConfig: redis.updateConfigSwarm ?? {
|
||||
Parallelism: 1,
|
||||
Order: "stop-first" as const,
|
||||
FailureAction: "rollback" as const,
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user