From 226c43047e0845e681505c2c12561a0e9572eb1c Mon Sep 17 00:00:00 2001 From: MD Mahbub Hasan Date: Sun, 27 Oct 2024 03:31:03 +0600 Subject: [PATCH] Portainer template added --- apps/dokploy/public/templates/portainer.svg | 1 + .../templates/portainer/docker-compose.yml | 30 +++++++++++++++++++ apps/dokploy/templates/portainer/index.ts | 19 ++++++++++++ apps/dokploy/templates/templates.ts | 16 ++++++++++ 4 files changed, 66 insertions(+) create mode 100644 apps/dokploy/public/templates/portainer.svg create mode 100644 apps/dokploy/templates/portainer/docker-compose.yml create mode 100644 apps/dokploy/templates/portainer/index.ts diff --git a/apps/dokploy/public/templates/portainer.svg b/apps/dokploy/public/templates/portainer.svg new file mode 100644 index 00000000..e8c91b36 --- /dev/null +++ b/apps/dokploy/public/templates/portainer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/dokploy/templates/portainer/docker-compose.yml b/apps/dokploy/templates/portainer/docker-compose.yml new file mode 100644 index 00000000..fa4fe410 --- /dev/null +++ b/apps/dokploy/templates/portainer/docker-compose.yml @@ -0,0 +1,30 @@ +version: '3.8' + +services: + agent: + image: portainer/agent + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/docker/volumes:/var/lib/docker/volumes + networks: + - dokploy-network + + deploy: + mode: global + placement: + constraints: [node.platform.os == linux] + + portainer: + image: portainer/portainer-ce + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - portainer-data:/data + deploy: + mode: replicated + placement: + constraints: [node.role == manager] + + +volumes: + portainer-data: + \ No newline at end of file diff --git a/apps/dokploy/templates/portainer/index.ts b/apps/dokploy/templates/portainer/index.ts new file mode 100644 index 00000000..7775a0ed --- /dev/null +++ b/apps/dokploy/templates/portainer/index.ts @@ -0,0 +1,19 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const domains: DomainSchema[] = [ + { + host: generateRandomDomain(schema), + port: 9000, + serviceName: "portainer", + }, + ]; + return { + domains, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 205bc857..1be5fc0a 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -512,4 +512,20 @@ export const templates: TemplateData[] = [ tags: ["self-hosted", "email", "webmail"], load: () => import("./roundcube/index").then((m) => m.generate), }, + + { + id: "portainer", + name: "Portainer", + version: "2.21.4", + description: + "Portainer is a container management tool for deploying, troubleshooting, and securing applications across cloud, data centers, and IoT.", + logo: "portainer.svg", + links: { + github: "https://github.com/portainer/portainer", + website: "https://www.portainer.io/", + docs: "https://docs.portainer.io/", + }, + tags: ["cloud", "monitoring"], + load: () => import("./portainer/index").then((m) => m.generate), + }, ];