feat(templates): add uptime kuma, directus, baserow, ghost, n8n

This commit is contained in:
Mauricio Siu
2024-06-29 19:14:46 -06:00
parent 85f025c729
commit 210fed30a2
19 changed files with 482 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
version: "3.4"
services:
baserow:
image: baserow/baserow:1.25.2
networks:
- dokploy-network
environment:
BASEROW_PUBLIC_URL: "http://${BASEROW_HOST}"
ports:
- "80"
labels:
- traefik.enable=true
- traefik.http.routers.${HASH}.rule=Host(`${BASEROW_HOST}`)
- traefik.http.services.${HASH}.loadbalancer.server.port=${BASEROW_PORT}
volumes:
- baserow_data:/baserow/data
volumes:
baserow_data:
networks:
dokploy-network:
external: true

View File

@@ -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 = [
`BASEROW_HOST=${randomDomain}`,
"BASEROW_PORT=80",
`HASH=${mainServiceHash}`,
];
return {
envs,
};
}

View File

@@ -0,0 +1,63 @@
version: "3"
services:
database:
image: postgis/postgis:13-master
volumes:
- directus:/var/lib/postgresql/data
networks:
- dokploy-network
environment:
POSTGRES_USER: "directus"
POSTGRES_PASSWORD: "directus"
POSTGRES_DB: "directus"
cache:
image: redis:6
networks:
- dokploy-network
directus:
image: directus/directus:10.12.1
networks:
- dokploy-network
ports:
- 8055
volumes:
- ./uploads:/directus/uploads
- ./extensions:/directus/extensions
depends_on:
- cache
- database
labels:
- traefik.enable=true
- traefik.http.routers.${HASH}.rule=Host(`${DIRECTUS_HOST}`)
- traefik.http.services.${HASH}.loadbalancer.server.port=${DIRECTUS_PORT}
environment:
SECRET: "replace-with-secure-random-value"
DB_CLIENT: "pg"
DB_HOST: "database"
DB_PORT: "5432"
DB_DATABASE: "directus"
DB_USER: "directus"
DB_PASSWORD: "directus"
CACHE_ENABLED: "true"
CACHE_AUTO_PURGE: "true"
CACHE_STORE: "redis"
REDIS: "redis://cache:6379"
ADMIN_EMAIL: "admin@example.com"
ADMIN_PASSWORD: "d1r3ctu5"
# Make sure to set this in production
# (see https://docs.directus.io/self-hosted/config-options#general)
# PUBLIC_URL: "https://directus.example.com"
# Environment variables can also be defined in a file (for example `.env`):
# env_file:
# - .env
networks:
dokploy-network:
external: true
volumes:
directus:

View File

@@ -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 = [
`DIRECTUS_HOST=${randomDomain}`,
"DIRECTUS_PORT=8055",
`HASH=${mainServiceHash}`,
];
return {
envs,
};
}

View File

@@ -0,0 +1,46 @@
version: '3.1'
services:
ghost:
image: ghost:5-alpine
restart: always
networks:
- dokploy-network
ports:
- 2368
environment:
# see https://ghost.org/docs/config/#configuration-options
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: example
database__connection__database: ghost
# this url value is just an example, and is likely wrong for your environment!
url: http://${GHOST_HOST}
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
#NODE_ENV: development
labels:
- traefik.enable=true
- traefik.http.routers.${HASH}.rule=Host(`${GHOST_HOST}`)
- traefik.http.services.${HASH}.loadbalancer.server.port=${GHOST_PORT}
volumes:
- ghost:/var/lib/ghost/content
db:
image: mysql:8.0
restart: always
networks:
- dokploy-network
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
- db:/var/lib/mysql
volumes:
ghost:
db:
networks:
dokploy-network:
external: true

20
templates/ghost/index.ts Normal file
View File

@@ -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 = [
`GHOST_HOST=${randomDomain}`,
"GHOST_PORT=2368",
`HASH=${mainServiceHash}`,
];
return {
envs,
};
}

View File

@@ -0,0 +1,20 @@
version: "3.8"
services:
grafana:
networks:
- dokploy-network
image: grafana/grafana-enterprise:9.5.20
restart: unless-stopped
ports:
- '3000'
labels:
- traefik.enable=true
- traefik.http.routers.${HASH}.rule=Host(`${GRAFANA_HOST}`)
- traefik.http.services.${HASH}.loadbalancer.server.port=${GRAFANA_PORT}
volumes:
- grafana-storage:/var/lib/grafana
networks:
dokploy-network:
external: true
volumes:
grafana-storage: {}

View File

@@ -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 = [
`GRAFANA_HOST=${randomDomain}`,
"GRAFANA_PORT=3000",
`HASH=${mainServiceHash}`,
];
return {
envs,
};
}

View File

@@ -0,0 +1,29 @@
version: "3.7"
services:
n8n:
image: docker.n8n.io/n8nio/n8n:1.48.1
restart: always
networks:
- dokploy-network
ports:
- "5678"
labels:
- traefik.enable=true
- traefik.http.routers.${HASH}.rule=Host(`${N8N_HOST}`)
- traefik.http.services.${HASH}.loadbalancer.server.port=${N8N_PORT}
environment:
- N8N_HOST=${N8N_HOST}
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_ENV=production
- WEBHOOK_URL=https://${N8N_HOST}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- N8N_SECURE_COOKIE=false
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
networks:
dokploy-network:
external: true

21
templates/n8n/index.ts Normal file
View File

@@ -0,0 +1,21 @@
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 = [
`N8N_HOST=${randomDomain}`,
"N8N_PORT=5678",
`HASH=${mainServiceHash}`,
"GENERIC_TIMEZONE=Europe/Berlin",
];
return {
envs,
};
}

View File

@@ -47,4 +47,94 @@ export const templates: TemplateData[] = [
tags: ["scheduling", "booking"],
load: () => import("./calcom/index").then((m) => m.generate),
},
{
id: "grafana",
name: "Grafana",
version: "9.5.20",
description:
"Grafana is an open source platform for data visualization and monitoring.",
logo: "grafana.svg",
links: {
github: "https://github.com/grafana/grafana",
website: "https://grafana.com/",
docs: "https://grafana.com/docs/",
},
tags: ["monitoring"],
load: () => import("./grafana/index").then((m) => m.generate),
},
{
id: "directus",
name: "Directus",
version: "10.12.1",
description:
"Directus is an open source headless CMS that provides an API-first solution for building custom backends.",
logo: "directus.jpg",
links: {
github: "https://github.com/directus/directus",
website: "https://directus.io/",
docs: "https://docs.directus.io/",
},
tags: ["cms"],
load: () => import("./directus/index").then((m) => m.generate),
},
{
id: "baserow",
name: "Baserow",
version: "1.25.2",
description:
"Baserow is an open source database management tool that allows you to create and manage databases.",
logo: "baserow.webp",
links: {
github: "https://github.com/Baserow/baserow",
website: "https://baserow.io/",
docs: "https://baserow.io/docs/index",
},
tags: ["database"],
load: () => import("./baserow/index").then((m) => m.generate),
},
{
id: "ghost",
name: "Ghost",
version: "5.0.0",
description:
"Ghost is a free and open source, professional publishing platform built on a modern Node.js technology stack.",
logo: "ghost.jpeg",
links: {
github: "https://github.com/TryGhost/Ghost",
website: "https://ghost.org/",
docs: "https://ghost.org/docs/",
},
tags: ["cms"],
load: () => import("./ghost/index").then((m) => m.generate),
},
{
id: "uptime-kuma",
name: "Uptime Kuma",
version: "1.21.4",
description:
"Uptime Kuma is a free and open source monitoring tool that allows you to monitor your websites and applications.",
logo: "uptime-kuma.png",
links: {
github: "https://github.com/louislam/uptime-kuma",
website: "https://uptime.kuma.pet/",
docs: "https://github.com/louislam/uptime-kuma/wiki",
},
tags: ["monitoring"],
load: () => import("./uptime-kuma/index").then((m) => m.generate),
},
{
id: "n8n",
name: "n8n",
version: "1.48.1",
description:
"n8n is an open source low-code platform for automating workflows and integrations.",
logo: "n8n.png",
links: {
github: "https://github.com/n8n-io/n8n",
website: "https://n8n.io/",
docs: "https://docs.n8n.io/",
},
tags: ["automation"],
load: () => import("./n8n/index").then((m) => m.generate),
},
];

View File

@@ -0,0 +1,21 @@
version: "3.4"
services:
uptime-kuma:
networks:
- dokploy-network
image: louislam/uptime-kuma:1
restart: always
ports:
- "3001"
volumes:
- uptime-kuma-data:/app/data
labels:
- traefik.enable=true
- traefik.http.routers.${HASH}.rule=Host(`${UPTIME_KUMA_HOST}`)
- traefik.http.services.${HASH}.loadbalancer.server.port=${UPTIME_KUMA_PORT}
volumes:
uptime-kuma-data:
networks:
dokploy-network:
external: true

View File

@@ -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 = [
`UPTIME_KUMA_HOST=${randomDomain}`,
"UPTIME_KUMA_PORT=3001",
`HASH=${mainServiceHash}`,
];
return {
envs,
};
}