diff --git a/public/templates/glitchtip.png b/public/templates/glitchtip.png new file mode 100644 index 00000000..86631752 Binary files /dev/null and b/public/templates/glitchtip.png differ diff --git a/templates/glitchtip/docker-compose.yml b/templates/glitchtip/docker-compose.yml new file mode 100644 index 00000000..a654a91b --- /dev/null +++ b/templates/glitchtip/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/templates/glitchtip/index.ts b/templates/glitchtip/index.ts new file mode 100644 index 00000000..98695cf8 --- /dev/null +++ b/templates/glitchtip/index.ts @@ -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, + }; +} diff --git a/templates/templates.ts b/templates/templates.ts index 85fb8a94..a4b1a995 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -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), + }, ];