mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: add docker registry upload
This commit is contained in:
@@ -13,6 +13,7 @@ import { buildCustomDocker } from "./docker-file";
|
||||
import { buildHeroku } from "./heroku";
|
||||
import { buildNixpacks } from "./nixpacks";
|
||||
import { buildPaketo } from "./paketo";
|
||||
import { uploadImage } from "../cluster/upload";
|
||||
|
||||
// NIXPACKS codeDirectory = where is the path of the code directory
|
||||
// HEROKU codeDirectory = where is the path of the code directory
|
||||
@@ -20,7 +21,7 @@ import { buildPaketo } from "./paketo";
|
||||
// DOCKERFILE codeDirectory = where is the exact path of the (Dockerfile)
|
||||
export type ApplicationNested = InferResultType<
|
||||
"applications",
|
||||
{ mounts: true; security: true; redirects: true; ports: true }
|
||||
{ mounts: true; security: true; redirects: true; ports: true; registry: true }
|
||||
>;
|
||||
export const buildApplication = async (
|
||||
application: ApplicationNested,
|
||||
@@ -42,6 +43,10 @@ export const buildApplication = async (
|
||||
} else if (buildType === "dockerfile") {
|
||||
await buildCustomDocker(application, writeStream);
|
||||
}
|
||||
|
||||
if (application.registryId) {
|
||||
await uploadImage(application, writeStream);
|
||||
}
|
||||
await mechanizeDockerContainer(application);
|
||||
writeStream.write("Docker Deployed: ✅");
|
||||
} catch (error) {
|
||||
@@ -67,6 +72,7 @@ export const mechanizeDockerContainer = async (
|
||||
cpuReservation,
|
||||
command,
|
||||
ports,
|
||||
replicas,
|
||||
} = application;
|
||||
|
||||
const resources = calculateResources({
|
||||
@@ -104,7 +110,7 @@ export const mechanizeDockerContainer = async (
|
||||
},
|
||||
Mode: {
|
||||
Replicated: {
|
||||
Replicas: 1,
|
||||
Replicas: replicas,
|
||||
},
|
||||
},
|
||||
EndpointSpec: {
|
||||
|
||||
Reference in New Issue
Block a user