Merge branch 'canary' of github.com:ChristoferMendes/dokploy into feature/add-custom-webhook-notification-provider

This commit is contained in:
ChristoferMendes
2025-11-11 09:11:38 -03:00
34 changed files with 7106 additions and 179 deletions

View File

@@ -143,6 +143,7 @@ export const mechanizeDockerContainer = async (
UpdateConfig,
Networks,
StopGracePeriod,
EndpointSpec,
} = generateConfigContainer(application);
const bindsMount = generateBindMounts(mounts);
@@ -183,14 +184,16 @@ export const mechanizeDockerContainer = async (
},
Mode,
RollbackConfig,
EndpointSpec: {
Ports: ports.map((port) => ({
PublishMode: port.publishMode,
Protocol: port.protocol,
TargetPort: port.targetPort,
PublishedPort: port.publishedPort,
})),
},
EndpointSpec: EndpointSpec
? EndpointSpec
: {
Ports: ports.map((port) => ({
PublishMode: port.publishMode,
Protocol: port.protocol,
TargetPort: port.targetPort,
PublishedPort: port.publishedPort,
})),
},
UpdateConfig,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),

View File

@@ -46,6 +46,7 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
UpdateConfig,
Networks,
StopGracePeriod,
EndpointSpec,
} = generateConfigContainer(mariadb);
const resources = calculateResources({
memoryLimit,
@@ -89,19 +90,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,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),

View File

@@ -92,6 +92,7 @@ ${command ?? "wait $MONGOD_PID"}`;
UpdateConfig,
Networks,
StopGracePeriod,
EndpointSpec,
} = generateConfigContainer(mongo);
const resources = calculateResources({
@@ -142,19 +143,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,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),

View File

@@ -52,6 +52,7 @@ export const buildMysql = async (mysql: MysqlNested) => {
UpdateConfig,
Networks,
StopGracePeriod,
EndpointSpec,
} = generateConfigContainer(mysql);
const resources = calculateResources({
memoryLimit,
@@ -95,19 +96,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,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),

View File

@@ -45,6 +45,7 @@ export const buildPostgres = async (postgres: PostgresNested) => {
UpdateConfig,
Networks,
StopGracePeriod,
EndpointSpec,
} = generateConfigContainer(postgres);
const resources = calculateResources({
memoryLimit,
@@ -88,19 +89,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,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),

View File

@@ -43,6 +43,7 @@ export const buildRedis = async (redis: RedisNested) => {
UpdateConfig,
Networks,
StopGracePeriod,
EndpointSpec,
} = generateConfigContainer(redis);
const resources = calculateResources({
memoryLimit,
@@ -85,19 +86,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,
...(StopGracePeriod !== undefined &&
StopGracePeriod !== null && { StopGracePeriod }),

View File

@@ -395,6 +395,7 @@ export const generateConfigContainer = (
mounts,
networkSwarm,
stopGracePeriodSwarm,
endpointSpecSwarm,
} = application;
const sanitizedStopGracePeriodSwarm =
@@ -408,11 +409,9 @@ export const generateConfigContainer = (
...(healthCheckSwarm && {
HealthCheck: healthCheckSwarm,
}),
...(restartPolicySwarm
? {
RestartPolicy: restartPolicySwarm,
}
: {}),
...(restartPolicySwarm && {
RestartPolicy: restartPolicySwarm,
}),
...(placementSwarm
? {
Placement: placementSwarm,
@@ -461,6 +460,18 @@ export const generateConfigContainer = (
: {
Networks: [{ Target: "dokploy-network" }],
}),
...(endpointSpecSwarm && {
EndpointSpec: {
...(endpointSpecSwarm.Mode && { Mode: endpointSpecSwarm.Mode }),
Ports:
endpointSpecSwarm.Ports?.map((port) => ({
Protocol: (port.Protocol || "tcp") as "tcp" | "udp" | "sctp",
TargetPort: port.TargetPort || 0,
PublishedPort: port.PublishedPort || 0,
PublishMode: (port.PublishMode || "host") as "ingress" | "host",
})) || [],
},
}),
};
};