mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor(templates): use domains tab instead of envs
This commit is contained in:
@@ -3,19 +3,7 @@ services:
|
||||
pocketbase:
|
||||
image: spectado/pocketbase:0.22.12
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- ${POCKETBASE_PORT}
|
||||
networks:
|
||||
- dokploy-network
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.${HASH}.rule=Host(`${POCKETBASE_HOST}`)
|
||||
- traefik.http.services.${HASH}.loadbalancer.server.port=${POCKETBASE_PORT}
|
||||
volumes:
|
||||
- /etc/dokploy/templates/${HASH}/data:/pb_data
|
||||
- /etc/dokploy/templates/${HASH}/public:/pb_public
|
||||
- /etc/dokploy/templates/${HASH}/migrations:/pb_migrations
|
||||
|
||||
networks:
|
||||
dokploy-network:
|
||||
external: true
|
||||
@@ -1,21 +1,22 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateHash,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const mainServiceHash = generateHash(schema.projectName);
|
||||
const randomDomain = generateRandomDomain(schema);
|
||||
const mainDomain = generateRandomDomain(schema);
|
||||
|
||||
const envs = [
|
||||
`POCKETBASE_HOST=${randomDomain}`,
|
||||
"POCKETBASE_PORT=80",
|
||||
`HASH=${mainServiceHash}`,
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 80,
|
||||
serviceName: "pocketbase",
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user