mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: set the registry url in image in case we have a registry asociated
This commit is contained in:
@@ -64,6 +64,7 @@ export const registryRouter = createTRPCRouter({
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return false;
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -238,3 +238,4 @@ export const settingsRouter = createTRPCRouter({
|
||||
return readConfigInPath(input.path);
|
||||
}),
|
||||
});
|
||||
// apt-get install apache2-utils
|
||||
|
||||
@@ -81,16 +81,31 @@ export const mechanizeDockerContainer = async (
|
||||
cpuLimit,
|
||||
cpuReservation,
|
||||
});
|
||||
|
||||
const volumesMount = generateVolumeMounts(mounts);
|
||||
const bindsMount = generateBindMounts(mounts);
|
||||
const filesMount = generateFileMounts(appName, mounts);
|
||||
const envVariables = prepareEnvironmentVariables(env);
|
||||
|
||||
const registry = application.registry;
|
||||
|
||||
const image =
|
||||
sourceType === "docker"
|
||||
? dockerImage!
|
||||
: registry
|
||||
? `${registry.registryUrl}/${appName}`
|
||||
: `${appName}:latest`;
|
||||
|
||||
const settings: CreateServiceOptions = {
|
||||
authconfig: {
|
||||
password: registry?.password || "",
|
||||
username: registry?.username || "",
|
||||
serveraddress: registry?.registryUrl || "",
|
||||
},
|
||||
Name: appName,
|
||||
TaskTemplate: {
|
||||
ContainerSpec: {
|
||||
Image: sourceType === "docker" ? dockerImage! : `${appName}:latest`,
|
||||
Image: image,
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
...(command
|
||||
|
||||
Reference in New Issue
Block a user