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,43 +0,0 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const secretKeyBase = generateBase64(64);
|
||||
const synthApiKey = generateBase64(32);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 3000,
|
||||
serviceName: "app",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`SECRET_KEY_BASE=${secretKeyBase}`,
|
||||
"SELF_HOSTED=true",
|
||||
`SYNTH_API_KEY=${synthApiKey}`,
|
||||
"RAILS_FORCE_SSL=false",
|
||||
"RAILS_ASSUME_SSL=false",
|
||||
"GOOD_JOB_EXECUTION_MODE=async",
|
||||
];
|
||||
|
||||
const mounts: Template["mounts"] = [
|
||||
{
|
||||
filePath: "./uploads",
|
||||
content: "This is where user uploads will be stored",
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
mounts,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
22
blueprints/maybe/template.yml
Normal file
22
blueprints/maybe/template.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
secret_key_base: ${generateBase64(64)}
|
||||
synth_api_key: ${generateBase64(32)}
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: app
|
||||
port: 3000
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
SECRET_KEY_BASE: ${secret_key_base}
|
||||
SELF_HOSTED: "true"
|
||||
SYNTH_API_KEY: ${synth_api_key}
|
||||
RAILS_FORCE_SSL: "false"
|
||||
RAILS_ASSUME_SSL: "false"
|
||||
GOOD_JOB_EXECUTION_MODE: "async"
|
||||
|
||||
mounts:
|
||||
- filePath: ./uploads
|
||||
content: "This is where user uploads will be stored"
|
||||
Reference in New Issue
Block a user