mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge branch 'canary' of https://github.com/Dokploy/dokploy into feat/refactor-format-and-lint
This commit is contained in:
@@ -40,7 +40,7 @@ const AddTemplateSchema = z.object({
|
||||
})
|
||||
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, {
|
||||
message:
|
||||
"App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
||||
"App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
||||
}),
|
||||
description: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ const AddComposeSchema = z.object({
|
||||
})
|
||||
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, {
|
||||
message:
|
||||
"App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
||||
"App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
||||
}),
|
||||
description: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -66,7 +66,7 @@ const baseDatabaseSchema = z.object({
|
||||
})
|
||||
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, {
|
||||
message:
|
||||
"App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
||||
"App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
|
||||
}),
|
||||
databasePassword: z.string(),
|
||||
dockerImage: z.string(),
|
||||
|
||||
BIN
public/templates/umami.png
Normal file
BIN
public/templates/umami.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -363,4 +363,19 @@ export const templates: TemplateData[] = [
|
||||
tags: ["email"],
|
||||
load: () => import("./doublezero/index").then((m) => m.generate),
|
||||
},
|
||||
{
|
||||
id: "umami",
|
||||
name: "Umami",
|
||||
version: "v2.12.1",
|
||||
description:
|
||||
"Umami is a simple, fast, privacy-focused alternative to Google Analytics.",
|
||||
logo: "umami.png",
|
||||
links: {
|
||||
github: "https://github.com/umami-software/umami",
|
||||
website: "https://umami.is",
|
||||
docs: "https://umami.is/docs",
|
||||
},
|
||||
tags: ["analytics"],
|
||||
load: () => import("./umami/index").then((m) => m.generate),
|
||||
},
|
||||
];
|
||||
|
||||
46
templates/umami/docker-compose.yml
Normal file
46
templates/umami/docker-compose.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
services:
|
||||
umami:
|
||||
image: ghcr.io/umami-software/umami:postgresql-v2.12.1
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- ${UMAMI_PORT}
|
||||
networks:
|
||||
- dokploy-network
|
||||
environment:
|
||||
DATABASE_URL: postgresql://umami:umami@db:5432/umami
|
||||
DATABASE_TYPE: postgresql
|
||||
APP_SECRET: ${APP_SECRET}
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${HASH}.rule=Host(`${UMAMI_HOST}`)"
|
||||
- "traefik.http.services.${HASH}.loadbalancer.server.port=${UMAMI_PORT}"
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- dokploy-network
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_DB: umami
|
||||
POSTGRES_USER: umami
|
||||
POSTGRES_PASSWORD: umami
|
||||
|
||||
networks:
|
||||
dokploy-network:
|
||||
external: true
|
||||
volumes:
|
||||
db-data:
|
||||
24
templates/umami/index.ts
Normal file
24
templates/umami/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {
|
||||
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 randomSecret = generateBase64();
|
||||
|
||||
const envs = [
|
||||
`UMAMI_HOST=${randomDomain}`,
|
||||
"UMAMI_PORT=3000",
|
||||
`APP_SECRET=${randomSecret}`,
|
||||
`HASH=${mainServiceHash}`,
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user