mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #217 from kdurek/feat/umami-template
feat: add umami template
This commit is contained in:
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 |
@@ -359,5 +359,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 {
|
||||
generateHash,
|
||||
generateRandomDomain,
|
||||
type Template,
|
||||
type Schema,
|
||||
generateBase64,
|
||||
} 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