fix: WIP Traefik

This commit is contained in:
Andras Bacsai
2022-05-18 16:54:04 +02:00
parent b006fe8f68
commit eb62888c39
6 changed files with 73 additions and 80 deletions

View File

@@ -64,12 +64,12 @@ export const post: RequestHandler = async (event) => {
}
} else if (type === 'traefik') {
try {
const found = await checkContainer('/var/run/docker.sock', 'coolify-haproxy');
if (found) {
await asyncExecShell(`docker stop -t 0 coolify-haproxy`);
await asyncExecShell(`docker rm coolify-haproxy`);
}
await startTraefikProxy('/var/run/docker.sock');
// const found = await checkContainer('/var/run/docker.sock', 'coolify-haproxy');
// if (found) {
// await asyncExecShell(`docker stop -t 0 coolify-haproxy`);
// await asyncExecShell(`docker rm coolify-haproxy`);
// }
// await startTraefikProxy('/var/run/docker.sock');
await db.prisma.setting.update({
where: { id: settings.id },
data: { isTraefikUsed: true }
@@ -83,12 +83,12 @@ export const post: RequestHandler = async (event) => {
}
} else if (type === 'haproxy') {
try {
const found = await checkContainer('/var/run/docker.sock', 'coolify-proxy');
if (found) {
await asyncExecShell(`docker stop -t 0 coolify-proxy`);
await asyncExecShell(`docker rm coolify-proxy`);
}
await startCoolifyProxy('/var/run/docker.sock');
// const found = await checkContainer('/var/run/docker.sock', 'coolify-proxy');
// if (found) {
// await asyncExecShell(`docker stop -t 0 coolify-proxy`);
// await asyncExecShell(`docker rm coolify-proxy`);
// }
// await startCoolifyProxy('/var/run/docker.sock');
await db.prisma.setting.update({
where: { id: settings.id },
data: { isTraefikUsed: false }