From baf555af5249e0d5d3e193e6304dc0fe870358f0 Mon Sep 17 00:00:00 2001 From: Cohvir Date: Sat, 22 Feb 2025 14:16:14 +0100 Subject: [PATCH 1/4] feat(template): add Wiki.js --- apps/dokploy/public/templates/wikijs.svg | 119 ++++++++++++++++++ apps/dokploy/templates/templates.ts | 14 +++ .../templates/wikijs/docker-compose.yml | 38 ++++++ apps/dokploy/templates/wikijs/index.ts | 35 ++++++ 4 files changed, 206 insertions(+) create mode 100644 apps/dokploy/public/templates/wikijs.svg create mode 100644 apps/dokploy/templates/wikijs/docker-compose.yml create mode 100644 apps/dokploy/templates/wikijs/index.ts diff --git a/apps/dokploy/public/templates/wikijs.svg b/apps/dokploy/public/templates/wikijs.svg new file mode 100644 index 00000000..78073b23 --- /dev/null +++ b/apps/dokploy/public/templates/wikijs.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 31668a6f..1e18f4ac 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1559,4 +1559,18 @@ export const templates: TemplateData[] = [ tags: ["backend", "database", "api"], load: () => import("./convex/index").then((m) => m.generate), }, + { + id: "wikijs", + name: "Wiki.js", + version: "2.5", + description: "The most powerful and extensible open source Wiki software.", + logo: "wikijs.svg", + links: { + github: "https://github.com/requarks/wiki", + website: "https://js.wiki/", + docs: "https://docs.requarks.io/", + }, + tags: ["knowledge-base", "self-hosted", "documentation"], + load: () => import("./wikijs/index").then((m) => m.generate), + }, ]; diff --git a/apps/dokploy/templates/wikijs/docker-compose.yml b/apps/dokploy/templates/wikijs/docker-compose.yml new file mode 100644 index 00000000..13277419 --- /dev/null +++ b/apps/dokploy/templates/wikijs/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.5' +services: + wiki: + image: ghcr.io/requarks/wiki:2.5 + restart: unless-stopped + ports: + # Change 5000 to the desired port + - "5000:3000" + environment: + - DB_TYPE + - DB_HOST + - DB_PORT + - DB_USER + - DB_PASS + - DB_NAME + depends_on: + - db + networks: + - dokploy-network + labels: + - traefik.enable=true + - traefik.constraint-label-stack=wikijs + db: + image: postgres:14 + restart: unless-stopped + environment: + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB + volumes: + - wiki-db-data:/var/lib/postgresql/data + networks: + - dokploy-network +networks: + dokploy-network: + external: true +volumes: + wiki-db-data: diff --git a/apps/dokploy/templates/wikijs/index.ts b/apps/dokploy/templates/wikijs/index.ts new file mode 100644 index 00000000..ff6c234d --- /dev/null +++ b/apps/dokploy/templates/wikijs/index.ts @@ -0,0 +1,35 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const domains: DomainSchema[] = [ + { + host: generateRandomDomain(schema), + port: 3000, + serviceName: "wiki", + }, + ]; + + const envs = [ + "# Database Setup", + "POSTGRES_USER=wikijs", + "POSTGRES_PASSWORD=wikijsrocks", + "POSTGRES_DB=wiki", + "# WikiJS Database Connection", + "DB_TYPE=postgres", + "DB_HOST=db", + "DB_PORT=5432", + "DB_USER=wikijs", + "DB_PASS=wikijsrocks", + "DB_NAME=wiki", + ]; + + return { + domains, + envs, + }; +} From f4d13c30302a342dd5fe4b99f25894aa699ebe97 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 23 Feb 2025 14:35:28 -0600 Subject: [PATCH 2/4] Update apps/dokploy/templates/wikijs/docker-compose.yml --- apps/dokploy/templates/wikijs/docker-compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/dokploy/templates/wikijs/docker-compose.yml b/apps/dokploy/templates/wikijs/docker-compose.yml index 13277419..137aca0c 100644 --- a/apps/dokploy/templates/wikijs/docker-compose.yml +++ b/apps/dokploy/templates/wikijs/docker-compose.yml @@ -3,9 +3,6 @@ services: wiki: image: ghcr.io/requarks/wiki:2.5 restart: unless-stopped - ports: - # Change 5000 to the desired port - - "5000:3000" environment: - DB_TYPE - DB_HOST From 5871a91da57a783f8b115cb6cdf6621638e71571 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 23 Feb 2025 14:35:33 -0600 Subject: [PATCH 3/4] Update apps/dokploy/templates/wikijs/docker-compose.yml --- apps/dokploy/templates/wikijs/docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/dokploy/templates/wikijs/docker-compose.yml b/apps/dokploy/templates/wikijs/docker-compose.yml index 137aca0c..c624f2fe 100644 --- a/apps/dokploy/templates/wikijs/docker-compose.yml +++ b/apps/dokploy/templates/wikijs/docker-compose.yml @@ -12,8 +12,6 @@ services: - DB_NAME depends_on: - db - networks: - - dokploy-network labels: - traefik.enable=true - traefik.constraint-label-stack=wikijs From c0b64c6e559ed74ca0ced596aa9747671a87ec3e Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 23 Feb 2025 14:35:39 -0600 Subject: [PATCH 4/4] Update apps/dokploy/templates/wikijs/docker-compose.yml --- apps/dokploy/templates/wikijs/docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/dokploy/templates/wikijs/docker-compose.yml b/apps/dokploy/templates/wikijs/docker-compose.yml index c624f2fe..6b21423d 100644 --- a/apps/dokploy/templates/wikijs/docker-compose.yml +++ b/apps/dokploy/templates/wikijs/docker-compose.yml @@ -24,8 +24,6 @@ services: - POSTGRES_DB volumes: - wiki-db-data:/var/lib/postgresql/data - networks: - - dokploy-network networks: dokploy-network: external: true