feat: add glitchtip template

This commit is contained in:
Mauricio Siu 2024-06-30 23:49:29 -06:00
parent addd102d39
commit a43627d869
4 changed files with 108 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,71 @@
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}
DEFAULT_FROM_EMAIL: email@glitchtip.com
CELERY_WORKER_AUTOSCALE: "1,3"
CELERY_WORKER_MAX_TASKS_PER_CHILD: "10000"
x-depends_on:
&default-depends_on
- postgres
- redis
services:
postgres:
image: postgres:16
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
restart: unless-stopped
volumes:
- pg-data:/var/lib/postgresql/data
networks:
- dokploy-network
redis:
image: redis
restart: unless-stopped
networks:
- dokploy-network
web:
image: glitchtip/glitchtip:v4.0
depends_on: *default-depends_on
ports:
- ${GLITCHTIP_PORT}
environment: *default-environment
restart: unless-stopped
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:
- uploads:/code/uploads
networks:
- dokploy-network
migrate:
image: glitchtip/glitchtip:v4.0
depends_on: *default-depends_on
command: "./manage.py migrate"
environment: *default-environment
networks:
- dokploy-network
volumes:
pg-data:
uploads:
networks:
dokploy-network:
external: true

View File

@ -0,0 +1,23 @@
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 secretKey = generateBase64(32);
const envs = [
`GLITCHTIP_HOST=${randomDomain}`,
"GLITCHTIP_PORT=8000",
`SECRET_KEY=${secretKey}`,
`HASH=${mainServiceHash}`,
];
return {
envs,
};
}

View File

@ -304,4 +304,18 @@ export const templates: TemplateData[] = [
tags: ["database", "dashboard"],
load: () => import("./metabase/index").then((m) => m.generate),
},
{
id: "glitchtip",
name: "Glitchtip",
version: "v4.0",
description: "Glitchtip is simple, open source error tracking",
logo: "glitchtip.png",
links: {
github: "https://github.com/glitchtip/glitchtip",
website: "https://glitchtip.com/",
docs: "https://glitchtip.com/documentation",
},
tags: ["hosting"],
load: () => import("./glitchtip/index").then((m) => m.generate),
},
];