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,46 +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 dbPassword = generatePassword();
|
||||
const dbUser = "immich";
|
||||
const _appSecret = generateBase64(32);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 2283,
|
||||
serviceName: "immich-server",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`IMMICH_HOST=${mainDomain}`,
|
||||
`SERVER_URL=https://${mainDomain}`,
|
||||
`FRONT_BASE_URL=https://${mainDomain}`,
|
||||
"# Database Configuration",
|
||||
"DB_HOSTNAME=immich-database",
|
||||
"DB_PORT=5432",
|
||||
`DB_USERNAME=${dbUser}`,
|
||||
`DB_PASSWORD=${dbPassword}`,
|
||||
"DB_DATABASE_NAME=immich",
|
||||
"# Redis Configuration",
|
||||
"REDIS_HOSTNAME=immich-redis",
|
||||
"REDIS_PORT=6379",
|
||||
"REDIS_DBINDEX=0",
|
||||
"# Server Configuration",
|
||||
"TZ=UTC",
|
||||
];
|
||||
|
||||
return {
|
||||
domains,
|
||||
envs,
|
||||
};
|
||||
}
|
||||
26
blueprints/immich/template.yml
Normal file
26
blueprints/immich/template.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
variables:
|
||||
main_domain: ${randomDomain}
|
||||
db_password: ${generatePassword}
|
||||
db_user: immich
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: immich-server
|
||||
port: 2283
|
||||
host: ${main_domain}
|
||||
|
||||
env:
|
||||
- IMMICH_HOST=${main_domain}
|
||||
- SERVER_URL=https://${main_domain}
|
||||
- FRONT_BASE_URL=https://${main_domain}
|
||||
- DB_HOSTNAME=immich-database
|
||||
- DB_PORT=5432
|
||||
- DB_USERNAME=${db_user}
|
||||
- DB_PASSWORD=${db_password}
|
||||
- DB_DATABASE_NAME=immich
|
||||
- REDIS_HOSTNAME=immich-redis
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_DBINDEX=0
|
||||
- TZ=UTC
|
||||
|
||||
mounts: []
|
||||
Reference in New Issue
Block a user