feat(template): added gotenberg, a pdf API service

This commit is contained in:
Tam Nguyen
2025-01-06 15:26:18 +11:00
parent 332416b7e7
commit 6866da97dd
4 changed files with 63 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

View File

@@ -0,0 +1,19 @@
services:
gotenberg:
image: gotenberg/gotenberg:8.15.2
container_name: gotenberg
environment:
# NOTE: requires the --api-enable-basic-auth option in "command"
# make sure to also change the credentials in Dokploy environment
GOTENBERG_API_BASIC_AUTH_USERNAME: ${GOTENBERG_API_BASIC_AUTH_USERNAME}
GOTENBERG_API_BASIC_AUTH_PASSWORD: ${GOTENBERG_API_BASIC_AUTH_PASSWORD}
command: [
"gotenberg",
# See the full list of options at https://gotenberg.dev/docs/configuration
# Examples:
"--api-enable-basic-auth"
#"--api-timeout=60s",
#"--chromium-auto-start"
]
restart: unless-stopped

View File

@@ -0,0 +1,29 @@
import {
type DomainSchema,
type Schema,
type Template,
generateRandomDomain,
} from "../utils";
export function generate(schema: Schema): Template {
const username = 'gotenberg';
const password = 'changethis';
const domains: DomainSchema[] = [
{
host: generateRandomDomain(schema),
port: 3000,
serviceName: "gotenberg",
},
];
const envs = [
`GOTENBERG_API_BASIC_AUTH_USERNAME=${username}`,
`GOTENBERG_API_BASIC_AUTH_PASSWORD=${password}`,
];
return {
envs,
domains,
};
}

View File

@@ -1196,4 +1196,19 @@ export const templates: TemplateData[] = [
tags: ["self-hosted", "monitoring", "uptime"],
load: () => import("./checkmate/index").then((m) => m.generate),
},
{
id: "gotenberg",
name: "Gotenberg",
version: "v8.15.2",
description:
"Gotenberg provides a developer-friendly API to interact with powerful tools like Chromium and LibreOffice for converting numerous document formats (HTML, Markdown, Word, Excel, etc.) into PDF files, and more!",
logo: "gotenberg.png",
links: {
github: "https://github.com/gotenberg/gotenberg",
website: "https://gotenberg.dev",
docs: "https://gotenberg.dev/docs/getting-started/introduction",
},
tags: ["api", "backend", "pdf"],
load: () => import("./gotenberg/index").then((m) => m.generate),
}
];