Add homelab installer and services (allprox, authelia, lldap)
This commit is contained in:
parent
68b23f1cbe
commit
bb754cdd8c
32 changed files with 2356 additions and 1 deletions
17
installer/src/compose.ts
Normal file
17
installer/src/compose.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { stringify } from "yaml";
|
||||
import type { ServiceMetadata } from "./types.ts";
|
||||
|
||||
/** Build the docker-compose.yml content for a service from its metadata. */
|
||||
export function generateComposeFile(meta: ServiceMetadata): string {
|
||||
const doc: Record<string, unknown> = {};
|
||||
|
||||
if (meta.networks && Object.keys(meta.networks).length > 0) {
|
||||
doc.networks = meta.networks;
|
||||
}
|
||||
if (meta.volumes && Object.keys(meta.volumes).length > 0) {
|
||||
doc.volumes = meta.volumes;
|
||||
}
|
||||
doc.services = { [meta.id]: meta.compose };
|
||||
|
||||
return stringify(doc, { lineWidth: 0 });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue