fix: wp + mysql on arm
This commit is contained in:
parent
375f17e728
commit
c431cee517
@ -972,7 +972,7 @@ export function generateDatabaseConfiguration(database: any, arch: string): Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function isARM(arch: string) {
|
export function isARM(arch: string) {
|
||||||
if (arch === 'arm' || arch === 'arm64') {
|
if (arch === 'arm' || arch === 'arm64' || arch === 'aarch' || arch === 'aarch64') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -34,7 +34,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
|
|||||||
const { id } = request.params;
|
const { id } = request.params;
|
||||||
const teamId = request.user.teamId;
|
const teamId = request.user.teamId;
|
||||||
const service = await getServiceFromDB({ id, teamId });
|
const service = await getServiceFromDB({ id, teamId });
|
||||||
const arm = isARM(service.arch)
|
const arm = isARM(process.arch);
|
||||||
const { type, destinationDockerId, destinationDocker, persistentStorage, exposePort } =
|
const { type, destinationDockerId, destinationDocker, persistentStorage, exposePort } =
|
||||||
service;
|
service;
|
||||||
|
|
||||||
@ -107,14 +107,16 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
|
|||||||
if (template.services[s].ports?.length > 0) {
|
if (template.services[s].ports?.length > 0) {
|
||||||
port = template.services[s].ports[0]
|
port = template.services[s].ports[0]
|
||||||
}
|
}
|
||||||
console.log({ arm })
|
let image = template.services[s].image
|
||||||
console.log(template.services[s].imageArm)
|
if (arm && template.services[s].imageArm) {
|
||||||
|
image = template.services[s].imageArm
|
||||||
|
}
|
||||||
config[s] = {
|
config[s] = {
|
||||||
container_name: s,
|
container_name: s,
|
||||||
build: template.services[s].build || undefined,
|
build: template.services[s].build || undefined,
|
||||||
command: template.services[s].command,
|
command: template.services[s].command,
|
||||||
entrypoint: template.services[s]?.entrypoint,
|
entrypoint: template.services[s]?.entrypoint,
|
||||||
image: arm ? template.services[s].imageArm : template.services[s].image,
|
image,
|
||||||
expose: template.services[s].ports,
|
expose: template.services[s].ports,
|
||||||
...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
|
...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
|
||||||
volumes: Array.from(volumes),
|
volumes: Array.from(volumes),
|
||||||
@ -126,6 +128,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
|
|||||||
labels: makeLabelForServices(type),
|
labels: makeLabelForServices(type),
|
||||||
...defaultComposeConfiguration(network),
|
...defaultComposeConfiguration(network),
|
||||||
}
|
}
|
||||||
|
console.log(config[s].image)
|
||||||
|
|
||||||
// Generate files for builds
|
// Generate files for builds
|
||||||
if (template.services[s]?.files?.length > 0) {
|
if (template.services[s]?.files?.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user