mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
feat: migrate templates
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generatePassword,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const adminDomain = generateRandomDomain(schema);
|
||||
const postgresPassword = generatePassword();
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 3001,
|
||||
serviceName: "app",
|
||||
},
|
||||
{
|
||||
host: adminDomain,
|
||||
port: 3002,
|
||||
serviceName: "app",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`LOGTO_ENDPOINT=http://${adminDomain}`,
|
||||
`LOGTO_ADMIN_ENDPOINT=http://${adminDomain}`,
|
||||
`LOGTO_POSTGRES_PASSWORD=${postgresPassword}`,
|
||||
];
|
||||
|
||||
return {
|
||||
domains,
|
||||
envs,
|
||||
};
|
||||
}
|
||||
20
blueprints/logto/template.yml
Normal file
20
blueprints/logto/template.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
admin_domain: ${randomDomain}
|
||||
postgres_password: ${generatePassword()}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: app
|
||||
port: 3001
|
||||
host: ${main_domain}
|
||||
- serviceName: app
|
||||
port: 3002
|
||||
host: ${admin_domain}
|
||||
|
||||
env:
|
||||
LOGTO_ENDPOINT: http://${admin_domain}
|
||||
LOGTO_ADMIN_ENDPOINT: http://${admin_domain}
|
||||
LOGTO_POSTGRES_PASSWORD: ${postgres_password}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user