Add: Peppermint.sh

This commit is contained in:
DrMxrcy
2024-11-12 12:33:34 -05:00
parent b08a2f54f0
commit ed470ee827
4 changed files with 106 additions and 0 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -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:

View File

@@ -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,
};
}

View File

@@ -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),
},
];