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,40 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generatePassword,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const apiDomain = generateRandomDomain(schema);
|
||||
const postgresPassword = generatePassword();
|
||||
const secret = generateBase64(32);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 3000,
|
||||
serviceName: "peppermint-app",
|
||||
},
|
||||
{
|
||||
host: apiDomain,
|
||||
port: 5003,
|
||||
serviceName: "peppermint-app",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`MAIN_DOMAIN=${mainDomain}`,
|
||||
`API_DOMAIN=${apiDomain}`,
|
||||
`POSTGRES_PASSWORD=${postgresPassword}`,
|
||||
`SECRET=${secret}`,
|
||||
];
|
||||
|
||||
return {
|
||||
domains,
|
||||
envs,
|
||||
};
|
||||
}
|
||||
22
blueprints/peppermint/template.yml
Normal file
22
blueprints/peppermint/template.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
api_domain: ${randomDomain}
|
||||
postgres_password: ${generatePassword()}
|
||||
secret: ${generateBase64(32)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: peppermint-app
|
||||
port: 3000
|
||||
host: ${main_domain}
|
||||
- serviceName: peppermint-app
|
||||
port: 5003
|
||||
host: ${api_domain}
|
||||
|
||||
env:
|
||||
MAIN_DOMAIN: ${main_domain}
|
||||
API_DOMAIN: ${api_domain}
|
||||
POSTGRES_PASSWORD: ${postgres_password}
|
||||
SECRET: ${secret}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user