mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
43 lines
996 B
TypeScript
43 lines
996 B
TypeScript
import {
|
|
type DomainSchema,
|
|
type Schema,
|
|
type Template,
|
|
generatePassword,
|
|
generateRandomDomain,
|
|
} from "../utils";
|
|
|
|
export function generate(schema: Schema): Template {
|
|
const mainDomain = generateRandomDomain(schema);
|
|
const postgresPassword = generatePassword();
|
|
|
|
const domains: DomainSchema[] = [
|
|
{
|
|
host: mainDomain,
|
|
port: 80,
|
|
serviceName: "caddy",
|
|
},
|
|
];
|
|
|
|
const envs = [
|
|
`WINDMILL_HOST=${mainDomain}`,
|
|
`POSTGRES_PASSWORD=${postgresPassword}`,
|
|
`DATABASE_URL=postgres://postgres:${postgresPassword}@db/windmill?sslmode=disable`,
|
|
];
|
|
|
|
const mounts: Template["mounts"] = [
|
|
{
|
|
filePath: "files/stacks/windmill/Caddyfile",
|
|
content: `{$BASE_URL} {
|
|
bind {$ADDRESS}
|
|
reverse_proxy /ws/* http://lsp:3001
|
|
reverse_proxy /* http://windmill_server:8000
|
|
}`
|
|
},
|
|
];
|
|
|
|
return {
|
|
domains,
|
|
envs,
|
|
mounts,
|
|
};
|
|
}
|