mirror of
https://github.com/andwati/dokploy.git
synced 2026-12-06 01:28:46 +00:00
refactor(templates): use domains tab instead of envs
This commit is contained in:
@@ -2,10 +2,6 @@ services:
|
||||
doublezero:
|
||||
restart: always
|
||||
image: liltechnomancer/double-zero:0.2.1
|
||||
ports:
|
||||
- ${DOUBLEZERO_PORT}
|
||||
networks:
|
||||
- dokploy-network
|
||||
volumes:
|
||||
- db-data:/var/lib/doublezero/data
|
||||
environment:
|
||||
@@ -17,15 +13,7 @@ services:
|
||||
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
|
||||
PHX_HOST: ${DOUBLEZERO_HOST}
|
||||
DATABASE_PATH: ./00.db
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${HASH}.rule=Host(`${DOUBLEZERO_HOST}`)"
|
||||
- "traefik.http.services.${HASH}.loadbalancer.server.port=${DOUBLEZERO_PORT}"
|
||||
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
dokploy-network:
|
||||
external: true
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generateHash,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainServiceHash = generateHash(schema.projectName);
|
||||
const randomDomain = generateRandomDomain(schema);
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
const secretKeyBase = generateBase64(64);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 4000,
|
||||
serviceName: "doublezero",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`DOUBLEZERO_HOST=${randomDomain}`,
|
||||
`DOUBLEZERO_HOST=${mainDomain}`,
|
||||
"DOUBLEZERO_PORT=4000",
|
||||
`HASH=${mainServiceHash}`,
|
||||
`SECRET_KEY_BASE=${secretKeyBase}`,
|
||||
"AWS_ACCESS_KEY_ID=your-aws-access-key",
|
||||
"AWS_SECRET_ACCESS_KEY=your-aws-secret-key",
|
||||
@@ -25,5 +31,6 @@ export function generate(schema: Schema): Template {
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user