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,32 +0,0 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
18
blueprints/phpmyadmin/template.yml
Normal file
18
blueprints/phpmyadmin/template.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
root_password: ${generatePassword(32)}
|
||||
user_password: ${generatePassword(32)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: phpmyadmin
|
||||
port: 80
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: ${root_password}
|
||||
MYSQL_DATABASE: "mysql"
|
||||
MYSQL_USER: "phpmyadmin"
|
||||
MYSQL_PASSWORD: ${user_password}
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user