mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
33 lines
603 B
TypeScript
33 lines
603 B
TypeScript
import {
|
|
type DomainSchema,
|
|
type Schema,
|
|
type Template,
|
|
generatePassword,
|
|
generateRandomDomain,
|
|
} from "../utils";
|
|
|
|
export function generate(schema: Schema): Template {
|
|
const mainDomain = generateRandomDomain(schema);
|
|
const rootPassword = generatePassword(32);
|
|
const password = generatePassword(32);
|
|
|
|
const domains: DomainSchema[] = [
|
|
{
|
|
host: mainDomain,
|
|
port: 80,
|
|
serviceName: "phpmyadmin",
|
|
},
|
|
];
|
|
const envs = [
|
|
`MYSQL_ROOT_PASSWORD=${rootPassword}`,
|
|
"MYSQL_DATABASE=mysql",
|
|
"MYSQL_USER=phpmyadmin",
|
|
`MYSQL_PASSWORD=${password}`,
|
|
];
|
|
|
|
return {
|
|
envs,
|
|
domains,
|
|
};
|
|
}
|