From ed470ee827ad62f2fe666a97cf7da30d127b0143 Mon Sep 17 00:00:00 2001 From: DrMxrcy Date: Tue, 12 Nov 2024 12:33:34 -0500 Subject: [PATCH] Add: Peppermint.sh --- apps/dokploy/public/templates/peppermint.svg | 13 ++++++ .../templates/peppermint/docker-compose.yml | 36 ++++++++++++++++ apps/dokploy/templates/peppermint/index.ts | 43 +++++++++++++++++++ apps/dokploy/templates/templates.ts | 14 ++++++ 4 files changed, 106 insertions(+) create mode 100644 apps/dokploy/public/templates/peppermint.svg create mode 100644 apps/dokploy/templates/peppermint/docker-compose.yml create mode 100644 apps/dokploy/templates/peppermint/index.ts diff --git a/apps/dokploy/public/templates/peppermint.svg b/apps/dokploy/public/templates/peppermint.svg new file mode 100644 index 00000000..b6fff994 --- /dev/null +++ b/apps/dokploy/public/templates/peppermint.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/apps/dokploy/templates/peppermint/docker-compose.yml b/apps/dokploy/templates/peppermint/docker-compose.yml new file mode 100644 index 00000000..a20bedf4 --- /dev/null +++ b/apps/dokploy/templates/peppermint/docker-compose.yml @@ -0,0 +1,36 @@ +version: "3.8" + +services: + peppermint_postgres: + image: postgres:latest + restart: always + networks: + - dokploy-network + volumes: + - pgdata:/var/lib/postgresql/data + environment: + POSTGRES_USER: peppermint + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: peppermint + healthcheck: + test: ["CMD-SHELL", "pg_isready -U peppermint"] + interval: 10s + timeout: 5s + retries: 5 + + peppermint: + image: pepperlabs/peppermint:latest + restart: always + networks: + - dokploy-network + depends_on: + peppermint_postgres: + condition: service_healthy + environment: + DB_USERNAME: "peppermint" + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_HOST: "peppermint_postgres" + SECRET: ${SECRET} + +volumes: + pgdata: \ No newline at end of file diff --git a/apps/dokploy/templates/peppermint/index.ts b/apps/dokploy/templates/peppermint/index.ts new file mode 100644 index 00000000..867a5254 --- /dev/null +++ b/apps/dokploy/templates/peppermint/index.ts @@ -0,0 +1,43 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateBase64, + generatePassword, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + // Generate domains and secrets + const mainDomain = generateRandomDomain(schema); + const apiDomain = generateRandomDomain(schema); + const postgresPassword = generatePassword(); + const secret = generateBase64(32); + + // Configure domain routing + const domains: DomainSchema[] = [ + { + host: mainDomain, + port: 3000, + serviceName: "peppermint", + }, + { + host: apiDomain, + port: 5003, + serviceName: "peppermint", + }, + ]; + + // Set environment variables + const envs = [ + `MAIN_DOMAIN=${mainDomain}`, + `API_DOMAIN=${apiDomain}`, + `POSTGRES_PASSWORD=${postgresPassword}`, + `SECRET=${secret}`, + ]; + + return { + domains, + envs, + }; +} \ No newline at end of file diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 28af7c56..8be8b2ed 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -702,4 +702,18 @@ export const templates: TemplateData[] = [ tags: ["IA", "chat"], load: () => import("./lobe-chat/index").then((m) => m.generate), }, + { + id: "peppermint", + name: "Peppermint", + version: "latest", + description: "Peppermint is a modern, open-source API development platform that helps you build, test and document your APIs.", + logo: "peppermint.svg", + links: { + github: "https://github.com/Peppermint-Lab/peppermint", + website: "https://peppermint.sh/", + docs: "https://docs.peppermint.sh/" + }, + tags: ["api", "development", "documentation"], + load: () => import("./peppermint/index").then((m) => m.generate), + }, ];