mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-18 09:55:19 +00:00
fix: remove legacy get docker image architecture
This commit is contained in:
@@ -8,27 +8,8 @@ import {
|
|||||||
generateVolumeMounts,
|
generateVolumeMounts,
|
||||||
prepareEnvironmentVariables,
|
prepareEnvironmentVariables,
|
||||||
} from "../docker/utils";
|
} from "../docker/utils";
|
||||||
import { execAsync, execAsyncRemote } from "../process/execAsync";
|
|
||||||
import { getRemoteDocker } from "../servers/remote-docker";
|
import { getRemoteDocker } from "../servers/remote-docker";
|
||||||
|
|
||||||
const getServerArchitecture = async (
|
|
||||||
serverId?: string | null,
|
|
||||||
): Promise<string> => {
|
|
||||||
if (!serverId) {
|
|
||||||
const { stdout } = await execAsync("uname -m");
|
|
||||||
return stdout.trim();
|
|
||||||
}
|
|
||||||
const { stdout } = await execAsyncRemote(serverId, "uname -m");
|
|
||||||
return stdout.trim();
|
|
||||||
};
|
|
||||||
|
|
||||||
const getLibsqlImage = (arch: string): string => {
|
|
||||||
if (arch === "aarch64" || arch === "arm64") {
|
|
||||||
return "ghcr.io/tursodatabase/libsql-server:latest-arm";
|
|
||||||
}
|
|
||||||
return "ghcr.io/tursodatabase/libsql-server:latest";
|
|
||||||
};
|
|
||||||
|
|
||||||
export type LibsqlNested = InferResultType<
|
export type LibsqlNested = InferResultType<
|
||||||
"libsql",
|
"libsql",
|
||||||
{
|
{
|
||||||
@@ -44,7 +25,6 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
|||||||
externalPort,
|
externalPort,
|
||||||
externalGRPCPort,
|
externalGRPCPort,
|
||||||
externalAdminPort,
|
externalAdminPort,
|
||||||
dockerImage,
|
|
||||||
memoryLimit,
|
memoryLimit,
|
||||||
memoryReservation,
|
memoryReservation,
|
||||||
databaseUser,
|
databaseUser,
|
||||||
@@ -55,18 +35,11 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
|||||||
cpuReservation,
|
cpuReservation,
|
||||||
command,
|
command,
|
||||||
mounts,
|
mounts,
|
||||||
serverId,
|
|
||||||
enableNamespaces,
|
enableNamespaces,
|
||||||
enableBottomlessReplication,
|
enableBottomlessReplication,
|
||||||
bottomlessReplicationDestination,
|
bottomlessReplicationDestination,
|
||||||
} = libsql;
|
} = libsql;
|
||||||
|
|
||||||
let finalDockerImage = dockerImage;
|
|
||||||
if (dockerImage === "ghcr.io/tursodatabase/libsql-server:latest") {
|
|
||||||
const arch = await getServerArchitecture(serverId);
|
|
||||||
finalDockerImage = getLibsqlImage(arch);
|
|
||||||
}
|
|
||||||
|
|
||||||
const basicAuth = Buffer.from(
|
const basicAuth = Buffer.from(
|
||||||
`${databaseUser}:${databasePassword}`,
|
`${databaseUser}:${databasePassword}`,
|
||||||
"utf-8",
|
"utf-8",
|
||||||
@@ -128,7 +101,7 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
|||||||
TaskTemplate: {
|
TaskTemplate: {
|
||||||
ContainerSpec: {
|
ContainerSpec: {
|
||||||
HealthCheck,
|
HealthCheck,
|
||||||
Image: finalDockerImage,
|
Image: "ghcr.io/tursodatabase/libsql-server:latest",
|
||||||
Env: envVariables,
|
Env: envVariables,
|
||||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||||
...(finalCommand
|
...(finalCommand
|
||||||
|
|||||||
Reference in New Issue
Block a user