mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-09 16:05:23 +02:00
Merge branch 'canary' into feat/libsql
This commit is contained in:
@@ -29,6 +29,7 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
|
||||
cpuLimit,
|
||||
cpuReservation,
|
||||
command,
|
||||
args,
|
||||
mounts,
|
||||
} = mariadb;
|
||||
|
||||
@@ -45,6 +46,9 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
|
||||
RollbackConfig,
|
||||
UpdateConfig,
|
||||
Networks,
|
||||
StopGracePeriod,
|
||||
EndpointSpec,
|
||||
Ulimits,
|
||||
} = generateConfigContainer(mariadb);
|
||||
const resources = calculateResources({
|
||||
memoryLimit,
|
||||
@@ -71,12 +75,16 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
|
||||
Image: dockerImage,
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
...(command
|
||||
? {
|
||||
Command: ["/bin/sh"],
|
||||
Args: ["-c", command],
|
||||
}
|
||||
: {}),
|
||||
...(StopGracePeriod !== null &&
|
||||
StopGracePeriod !== undefined && { StopGracePeriod }),
|
||||
...(command && {
|
||||
Command: command.split(" "),
|
||||
}),
|
||||
...(args &&
|
||||
args.length > 0 && {
|
||||
Args: args,
|
||||
}),
|
||||
...(Ulimits && { Ulimits }),
|
||||
Labels,
|
||||
},
|
||||
Networks,
|
||||
@@ -88,19 +96,21 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
|
||||
},
|
||||
Mode,
|
||||
RollbackConfig,
|
||||
EndpointSpec: {
|
||||
Mode: "dnsrr",
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp",
|
||||
TargetPort: 3306,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
EndpointSpec: EndpointSpec
|
||||
? EndpointSpec
|
||||
: {
|
||||
Mode: "dnsrr" as const,
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp" as const,
|
||||
TargetPort: 3306,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host" as const,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
};
|
||||
try {
|
||||
|
||||
@@ -28,6 +28,7 @@ export const buildMongo = async (mongo: MongoNested) => {
|
||||
databaseUser,
|
||||
databasePassword,
|
||||
command,
|
||||
args,
|
||||
mounts,
|
||||
replicaSets,
|
||||
} = mongo;
|
||||
@@ -53,7 +54,7 @@ if [ "$REPLICA_STATUS" != "1" ]; then
|
||||
mongosh --eval '
|
||||
rs.initiate({
|
||||
_id: "rs0",
|
||||
members: [{ _id: 0, host: "localhost:27017", priority: 1 }]
|
||||
members: [{ _id: 0, host: "${appName}:27017", priority: 1 }]
|
||||
});
|
||||
|
||||
// Wait for the replica set to initialize
|
||||
@@ -91,6 +92,9 @@ ${command ?? "wait $MONGOD_PID"}`;
|
||||
RollbackConfig,
|
||||
UpdateConfig,
|
||||
Networks,
|
||||
StopGracePeriod,
|
||||
EndpointSpec,
|
||||
Ulimits,
|
||||
} = generateConfigContainer(mongo);
|
||||
|
||||
const resources = calculateResources({
|
||||
@@ -119,17 +123,24 @@ ${command ?? "wait $MONGOD_PID"}`;
|
||||
Image: dockerImage,
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
...(StopGracePeriod !== null &&
|
||||
StopGracePeriod !== undefined && { StopGracePeriod }),
|
||||
...(replicaSets
|
||||
? {
|
||||
Command: ["/bin/bash"],
|
||||
Args: ["-c", startupScript],
|
||||
}
|
||||
: {
|
||||
...(command && {
|
||||
Command: ["/bin/bash"],
|
||||
Args: ["-c", command],
|
||||
}),
|
||||
}),
|
||||
: {}),
|
||||
...(command &&
|
||||
!replicaSets && {
|
||||
Command: command.split(" "),
|
||||
}),
|
||||
...(args &&
|
||||
args.length > 0 &&
|
||||
!replicaSets && {
|
||||
Args: args,
|
||||
}),
|
||||
...(Ulimits && { Ulimits }),
|
||||
Labels,
|
||||
},
|
||||
Networks,
|
||||
@@ -141,19 +152,21 @@ ${command ?? "wait $MONGOD_PID"}`;
|
||||
},
|
||||
Mode,
|
||||
RollbackConfig,
|
||||
EndpointSpec: {
|
||||
Mode: "dnsrr",
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp",
|
||||
TargetPort: 27017,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
EndpointSpec: EndpointSpec
|
||||
? EndpointSpec
|
||||
: {
|
||||
Mode: "dnsrr" as const,
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp" as const,
|
||||
TargetPort: 27017,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host" as const,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
};
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ export const buildMysql = async (mysql: MysqlNested) => {
|
||||
cpuLimit,
|
||||
cpuReservation,
|
||||
command,
|
||||
args,
|
||||
mounts,
|
||||
} = mysql;
|
||||
|
||||
@@ -51,6 +52,9 @@ export const buildMysql = async (mysql: MysqlNested) => {
|
||||
RollbackConfig,
|
||||
UpdateConfig,
|
||||
Networks,
|
||||
StopGracePeriod,
|
||||
EndpointSpec,
|
||||
Ulimits,
|
||||
} = generateConfigContainer(mysql);
|
||||
const resources = calculateResources({
|
||||
memoryLimit,
|
||||
@@ -77,12 +81,16 @@ export const buildMysql = async (mysql: MysqlNested) => {
|
||||
Image: dockerImage,
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
...(command
|
||||
? {
|
||||
Command: ["/bin/sh"],
|
||||
Args: ["-c", command],
|
||||
}
|
||||
: {}),
|
||||
...(StopGracePeriod !== null &&
|
||||
StopGracePeriod !== undefined && { StopGracePeriod }),
|
||||
...(command && {
|
||||
Command: command.split(" "),
|
||||
}),
|
||||
...(args &&
|
||||
args.length > 0 && {
|
||||
Args: args,
|
||||
}),
|
||||
...(Ulimits && { Ulimits }),
|
||||
Labels,
|
||||
},
|
||||
Networks,
|
||||
@@ -94,19 +102,21 @@ export const buildMysql = async (mysql: MysqlNested) => {
|
||||
},
|
||||
Mode,
|
||||
RollbackConfig,
|
||||
EndpointSpec: {
|
||||
Mode: "dnsrr",
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp",
|
||||
TargetPort: 3306,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
EndpointSpec: EndpointSpec
|
||||
? EndpointSpec
|
||||
: {
|
||||
Mode: "dnsrr" as const,
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp" as const,
|
||||
TargetPort: 3306,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host" as const,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
};
|
||||
try {
|
||||
|
||||
@@ -28,6 +28,7 @@ export const buildPostgres = async (postgres: PostgresNested) => {
|
||||
databaseUser,
|
||||
databasePassword,
|
||||
command,
|
||||
args,
|
||||
mounts,
|
||||
} = postgres;
|
||||
|
||||
@@ -44,6 +45,9 @@ export const buildPostgres = async (postgres: PostgresNested) => {
|
||||
RollbackConfig,
|
||||
UpdateConfig,
|
||||
Networks,
|
||||
StopGracePeriod,
|
||||
EndpointSpec,
|
||||
Ulimits,
|
||||
} = generateConfigContainer(postgres);
|
||||
const resources = calculateResources({
|
||||
memoryLimit,
|
||||
@@ -70,12 +74,16 @@ export const buildPostgres = async (postgres: PostgresNested) => {
|
||||
Image: dockerImage,
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
...(command
|
||||
? {
|
||||
Command: ["/bin/sh"],
|
||||
Args: ["-c", command],
|
||||
}
|
||||
: {}),
|
||||
...(StopGracePeriod !== null &&
|
||||
StopGracePeriod !== undefined && { StopGracePeriod }),
|
||||
...(command && {
|
||||
Command: command.split(" "),
|
||||
}),
|
||||
...(args &&
|
||||
args.length > 0 && {
|
||||
Args: args,
|
||||
}),
|
||||
...(Ulimits && { Ulimits }),
|
||||
Labels,
|
||||
},
|
||||
Networks,
|
||||
@@ -87,19 +95,21 @@ export const buildPostgres = async (postgres: PostgresNested) => {
|
||||
},
|
||||
Mode,
|
||||
RollbackConfig,
|
||||
EndpointSpec: {
|
||||
Mode: "dnsrr",
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp",
|
||||
TargetPort: 5432,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
EndpointSpec: EndpointSpec
|
||||
? EndpointSpec
|
||||
: {
|
||||
Mode: "dnsrr" as const,
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp" as const,
|
||||
TargetPort: 5432,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host" as const,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
};
|
||||
try {
|
||||
|
||||
@@ -26,6 +26,7 @@ export const buildRedis = async (redis: RedisNested) => {
|
||||
cpuLimit,
|
||||
cpuReservation,
|
||||
command,
|
||||
args,
|
||||
mounts,
|
||||
} = redis;
|
||||
|
||||
@@ -42,6 +43,9 @@ export const buildRedis = async (redis: RedisNested) => {
|
||||
RollbackConfig,
|
||||
UpdateConfig,
|
||||
Networks,
|
||||
StopGracePeriod,
|
||||
EndpointSpec,
|
||||
Ulimits,
|
||||
} = generateConfigContainer(redis);
|
||||
const resources = calculateResources({
|
||||
memoryLimit,
|
||||
@@ -68,11 +72,23 @@ export const buildRedis = async (redis: RedisNested) => {
|
||||
Image: dockerImage,
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
Command: ["/bin/sh"],
|
||||
Args: [
|
||||
"-c",
|
||||
command ? command : `redis-server --requirepass ${databasePassword}`,
|
||||
],
|
||||
...(StopGracePeriod !== null &&
|
||||
StopGracePeriod !== undefined && { StopGracePeriod }),
|
||||
...(command || args
|
||||
? {
|
||||
...(command && {
|
||||
Command: command.split(" "),
|
||||
}),
|
||||
...(args &&
|
||||
args.length > 0 && {
|
||||
Args: args,
|
||||
}),
|
||||
}
|
||||
: {
|
||||
Command: ["/bin/sh"],
|
||||
Args: ["-c", `redis-server --requirepass ${databasePassword}`],
|
||||
}),
|
||||
...(Ulimits && { Ulimits }),
|
||||
Labels,
|
||||
},
|
||||
Networks,
|
||||
@@ -84,19 +100,21 @@ export const buildRedis = async (redis: RedisNested) => {
|
||||
},
|
||||
Mode,
|
||||
RollbackConfig,
|
||||
EndpointSpec: {
|
||||
Mode: "dnsrr",
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp",
|
||||
TargetPort: 6379,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
EndpointSpec: EndpointSpec
|
||||
? EndpointSpec
|
||||
: {
|
||||
Mode: "dnsrr" as const,
|
||||
Ports: externalPort
|
||||
? [
|
||||
{
|
||||
Protocol: "tcp" as const,
|
||||
TargetPort: 6379,
|
||||
PublishedPort: externalPort,
|
||||
PublishMode: "host" as const,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
UpdateConfig,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user