diff --git a/public/templates/excalidraw.jpg b/public/templates/excalidraw.jpg new file mode 100644 index 00000000..5c92a30c Binary files /dev/null and b/public/templates/excalidraw.jpg differ diff --git a/templates/excalidraw/docker-compose.yml b/templates/excalidraw/docker-compose.yml new file mode 100644 index 00000000..58920b39 --- /dev/null +++ b/templates/excalidraw/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.8' + +services: + excalidraw: + networks: + - dokploy-network + image: excalidraw/excalidraw:latest + ports: + - ${EXCALIDRAW_PORT} + labels: + - traefik.enable=true + - traefik.http.routers.${HASH}.rule=Host(`${EXCALIDRAW_HOST}`) + - traefik.http.services.${HASH}.loadbalancer.server.port=${EXCALIDRAW_PORT} + +networks: + dokploy-network: + external: true diff --git a/templates/excalidraw/index.ts b/templates/excalidraw/index.ts new file mode 100644 index 00000000..e22d7abb --- /dev/null +++ b/templates/excalidraw/index.ts @@ -0,0 +1,20 @@ +import { + generateHash, + generateRandomDomain, + type Template, + type Schema, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainServiceHash = generateHash(schema.projectName); + const randomDomain = generateRandomDomain(schema); + const envs = [ + `EXCALIDRAW_HOST=${randomDomain}`, + "EXCALIDRAW_PORT=80", + `HASH=${mainServiceHash}`, + ]; + + return { + envs, + }; +} diff --git a/templates/templates.ts b/templates/templates.ts index a57c3303..4bb9acd7 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -182,4 +182,19 @@ export const templates: TemplateData[] = [ tags: ["cms"], load: () => import("./appsmith/index").then((m) => m.generate), }, + { + id: "excalidraw", + name: "Excalidraw", + version: "latest", + description: + "Excalidraw is a free and open source online diagramming tool that lets you easily create and share beautiful diagrams.", + logo: "excalidraw.jpg", + links: { + github: "https://github.com/excalidraw/excalidraw", + website: "https://excalidraw.com/", + docs: "https://docs.excalidraw.com/", + }, + tags: ["drawing"], + load: () => import("./excalidraw/index").then((m) => m.generate), + }, ];