mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-15 16:35:17 +00:00
refactor(templates): use domains tab instead of envs
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
x-environment:
|
||||
&default-environment
|
||||
x-environment: &default-environment
|
||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
|
||||
SECRET_KEY: ${SECRET_KEY}
|
||||
PORT: ${GLITCHTIP_PORT}
|
||||
EMAIL_URL: consolemail://
|
||||
GLITCHTIP_DOMAIN: http://${GLITCHTIP_HOST}
|
||||
GLITCHTIP_DOMAIN: http://${GLITCHTIP_HOST}
|
||||
DEFAULT_FROM_EMAIL: [email protected]
|
||||
CELERY_WORKER_AUTOSCALE: "1,3"
|
||||
CELERY_WORKER_AUTOSCALE: "1,3"
|
||||
CELERY_WORKER_MAX_TASKS_PER_CHILD: "10000"
|
||||
|
||||
x-depends_on:
|
||||
&default-depends_on
|
||||
x-depends_on: &default-depends_on
|
||||
- postgres
|
||||
- redis
|
||||
|
||||
@@ -18,7 +16,7 @@ services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
environment:
|
||||
POSTGRES_HOST_AUTH_METHOD: "trust"
|
||||
POSTGRES_HOST_AUTH_METHOD: "trust"
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- pg-data:/var/lib/postgresql/data
|
||||
@@ -36,21 +34,15 @@ services:
|
||||
- ${GLITCHTIP_PORT}
|
||||
environment: *default-environment
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
volumes:
|
||||
- uploads:/code/uploads
|
||||
networks:
|
||||
- dokploy-network
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.${HASH}.rule=Host(`${GLITCHTIP_HOST}`)
|
||||
- traefik.http.services.${HASH}.loadbalancer.server.port=${GLITCHTIP_PORT}
|
||||
worker:
|
||||
image: glitchtip/glitchtip:v4.0
|
||||
command: ./bin/run-celery-with-beat.sh
|
||||
depends_on: *default-depends_on
|
||||
environment: *default-environment
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
volumes:
|
||||
- uploads:/code/uploads
|
||||
networks:
|
||||
- dokploy-network
|
||||
@@ -65,7 +57,3 @@ services:
|
||||
volumes:
|
||||
pg-data:
|
||||
uploads:
|
||||
|
||||
networks:
|
||||
dokploy-network:
|
||||
external: true
|
||||
@@ -1,23 +1,30 @@
|
||||
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 secretKey = generateBase64(32);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: mainDomain,
|
||||
port: 8000,
|
||||
serviceName: "web",
|
||||
},
|
||||
];
|
||||
const envs = [
|
||||
`GLITCHTIP_HOST=${randomDomain}`,
|
||||
`GLITCHTIP_HOST=${mainDomain}`,
|
||||
"GLITCHTIP_PORT=8000",
|
||||
`SECRET_KEY=${secretKey}`,
|
||||
`HASH=${mainServiceHash}`,
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user