mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-05 03:32:16 +00:00
39 lines
789 B
TypeScript
39 lines
789 B
TypeScript
import {
|
|
type DomainSchema,
|
|
type Schema,
|
|
type Template,
|
|
generateRandomDomain,
|
|
} from "../utils";
|
|
|
|
export function generate(schema: Schema): Template {
|
|
const dashboardDomain = generateRandomDomain(schema);
|
|
const backendDomain = generateRandomDomain(schema);
|
|
const actionsDomain = generateRandomDomain(schema);
|
|
|
|
const domains: DomainSchema[] = [
|
|
{
|
|
host: dashboardDomain,
|
|
port: 6791,
|
|
serviceName: "dashboard",
|
|
},
|
|
{
|
|
host: backendDomain,
|
|
port: 3210,
|
|
serviceName: "backend",
|
|
},
|
|
{
|
|
host: actionsDomain,
|
|
port: 3211,
|
|
serviceName: "backend",
|
|
},
|
|
];
|
|
|
|
const envs = [
|
|
`NEXT_PUBLIC_DEPLOYMENT_URL=http://${backendDomain}`,
|
|
`CONVEX_CLOUD_ORIGIN=http://${backendDomain}`,
|
|
`CONVEX_SITE_ORIGIN=http://${actionsDomain}`,
|
|
];
|
|
|
|
return { envs, domains };
|
|
}
|