add main router and service in traefik config

This commit is contained in:
Milo Schwartz 2024-10-20 13:15:20 -04:00
parent 002614499b
commit a5df7b881a
No known key found for this signature in database

View file

@ -31,8 +31,25 @@ export function buildTraefikConfig(
} }
const http: DynamicTraefikConfig["http"] = { const http: DynamicTraefikConfig["http"] = {
routers: {}, routers: {
services: {}, main: {
entryPoints: ["https"],
middlewares: [],
service: "service-main",
rule: "Host(`fossorial.io`)",
},
},
services: {
"service-main": {
loadBalancer: {
servers: [
{
url: `http://${config.server.internal_hostname}:${config.server.internal_port}`,
},
],
},
},
},
middlewares: { middlewares: {
[middlewareName]: { [middlewareName]: {
plugin: { plugin: {
@ -46,7 +63,6 @@ export function buildTraefikConfig(
}, },
}, },
}; };
for (const target of targets) { for (const target of targets) {
const routerName = `router-${target.targetId}`; const routerName = `router-${target.targetId}`;
const serviceName = `service-${target.targetId}`; const serviceName = `service-${target.targetId}`;