hmm
This commit is contained in:
parent
27dfa24cfb
commit
8cb73e1680
@ -7,7 +7,7 @@ import { checkContainer } from '../lib/docker';
|
|||||||
try {
|
try {
|
||||||
const { default: isReachable } = await import('is-port-reachable');
|
const { default: isReachable } = await import('is-port-reachable');
|
||||||
let portReachable;
|
let portReachable;
|
||||||
const { arch } = await listSettings();
|
const { arch, ipv4, ipv6 } = await listSettings();
|
||||||
// Coolify Proxy local
|
// Coolify Proxy local
|
||||||
const engine = '/var/run/docker.sock';
|
const engine = '/var/run/docker.sock';
|
||||||
const localDocker = await prisma.destinationDocker.findFirst({
|
const localDocker = await prisma.destinationDocker.findFirst({
|
||||||
@ -22,7 +22,7 @@ import { checkContainer } from '../lib/docker';
|
|||||||
command: `docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
|
command: `docker stop -t 0 coolify-haproxy && docker rm coolify-haproxy`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
portReachable = await isReachable(80, { host: 'localhost' })
|
portReachable = await isReachable(80, { host: ipv4 || ipv6 })
|
||||||
if (!portReachable) {
|
if (!portReachable) {
|
||||||
await startTraefikProxy(localDocker.id);
|
await startTraefikProxy(localDocker.id);
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ import { checkContainer } from '../lib/docker';
|
|||||||
command: `docker stop -t 0 haproxy-for-${publicPort} && docker rm haproxy-for-${publicPort}`
|
command: `docker stop -t 0 haproxy-for-${publicPort} && docker rm haproxy-for-${publicPort}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
portReachable = await isReachable(publicPort, { host: destinationDocker.remoteIpAddress || 'localhost' })
|
portReachable = await isReachable(publicPort, { host: destinationDocker.remoteIpAddress || ipv4 || ipv6 })
|
||||||
if (!portReachable) {
|
if (!portReachable) {
|
||||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
|
await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ import { checkContainer } from '../lib/docker';
|
|||||||
command: `docker stop -t 0 haproxy -for-${ftpPublicPort} && docker rm haproxy-for-${ftpPublicPort}`
|
command: `docker stop -t 0 haproxy -for-${ftpPublicPort} && docker rm haproxy-for-${ftpPublicPort}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
portReachable = await isReachable(ftpPublicPort, { host: destinationDocker.remoteIpAddress || 'localhost' })
|
portReachable = await isReachable(ftpPublicPort, { host: destinationDocker.remoteIpAddress || ipv4 || ipv6 })
|
||||||
if (!portReachable) {
|
if (!portReachable) {
|
||||||
await startTraefikTCPProxy(destinationDocker, id, ftpPublicPort, 22, 'wordpressftp');
|
await startTraefikTCPProxy(destinationDocker, id, ftpPublicPort, 22, 'wordpressftp');
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ import { checkContainer } from '../lib/docker';
|
|||||||
command: `docker stop -t 0 ${id}-${publicPort} && docker rm ${id}-${publicPort} `
|
command: `docker stop -t 0 ${id}-${publicPort} && docker rm ${id}-${publicPort} `
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
portReachable = await isReachable(publicPort, { host: destinationDocker.remoteIpAddress || 'localhost' })
|
portReachable = await isReachable(publicPort, { host: destinationDocker.remoteIpAddress || ipv4 || ipv6 })
|
||||||
if (!portReachable) {
|
if (!portReachable) {
|
||||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user