From 1e834ed1d987946930b50a61fe83ec92048ec990 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 14 Dec 2024 20:17:20 -0600 Subject: [PATCH 1/2] feat: add elastic search --- .../public/templates/elasticsearch.svg | 1 + .../elastic-search/docker-compose.yml | 34 +++++++++++++++++++ .../dokploy/templates/elastic-search/index.ts | 28 +++++++++++++++ apps/dokploy/templates/templates.ts | 15 ++++++++ 4 files changed, 78 insertions(+) create mode 100644 apps/dokploy/public/templates/elasticsearch.svg create mode 100644 apps/dokploy/templates/elastic-search/docker-compose.yml create mode 100644 apps/dokploy/templates/elastic-search/index.ts diff --git a/apps/dokploy/public/templates/elasticsearch.svg b/apps/dokploy/public/templates/elasticsearch.svg new file mode 100644 index 00000000..b95507cd --- /dev/null +++ b/apps/dokploy/public/templates/elasticsearch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/dokploy/templates/elastic-search/docker-compose.yml b/apps/dokploy/templates/elastic-search/docker-compose.yml new file mode 100644 index 00000000..929006ff --- /dev/null +++ b/apps/dokploy/templates/elastic-search/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3.8' + +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2 + container_name: elasticsearch + environment: + - discovery.type=single-node + - xpack.security.enabled=false + - bootstrap.memory_lock=true + - ES_JAVA_OPTS=-Xms512m -Xmx512m + ulimits: + memlock: + soft: -1 + hard: -1 + ports: + - "9200" + volumes: + - es_data:/usr/share/elasticsearch/data + + kibana: + image: docker.elastic.co/kibana/kibana:8.10.2 + container_name: kibana + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + ports: + - "5601" + depends_on: + - elasticsearch + +volumes: + es_data: + driver: local + \ No newline at end of file diff --git a/apps/dokploy/templates/elastic-search/index.ts b/apps/dokploy/templates/elastic-search/index.ts new file mode 100644 index 00000000..5a3a31e1 --- /dev/null +++ b/apps/dokploy/templates/elastic-search/index.ts @@ -0,0 +1,28 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const mainDomain = generateRandomDomain(schema); + const apiDomain = generateRandomDomain(schema); + + const domains: DomainSchema[] = [ + { + host: mainDomain, + port: 5601, + serviceName: "kibana", + }, + { + host: apiDomain, + port: 9200, + serviceName: "elasticsearch", + }, + ]; + + return { + domains, + }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 9aaf1ee0..adfc021c 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1121,4 +1121,19 @@ export const templates: TemplateData[] = [ tags: ["ai"], load: () => import("./langflow/index").then((m) => m.generate), }, + { + id: "elastic-search", + name: "Elasticsearch", + version: "1.1.1", + description: + "Elasticsearch is an open-source search and analytics engine, used for full-text search and analytics on structured data such as text, web pages, images, and videos.", + logo: "elasticsearch.svg", + links: { + github: "https://github.com/elastic/elasticsearch", + website: "https://www.elastic.co/elasticsearch/", + docs: "https://docs.elastic.co/elasticsearch/", + }, + tags: ["ai"], + load: () => import("./elastic-search/index").then((m) => m.generate), + }, ]; From 3fe057c7f82c8f52a19666f25395184ce0f1e40f Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 14 Dec 2024 20:17:38 -0600 Subject: [PATCH 2/2] refactor: set version --- apps/dokploy/templates/templates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index adfc021c..39243356 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1124,7 +1124,7 @@ export const templates: TemplateData[] = [ { id: "elastic-search", name: "Elasticsearch", - version: "1.1.1", + version: "8.10.2", description: "Elasticsearch is an open-source search and analytics engine, used for full-text search and analytics on structured data such as text, web pages, images, and videos.", logo: "elasticsearch.svg", @@ -1133,7 +1133,7 @@ export const templates: TemplateData[] = [ website: "https://www.elastic.co/elasticsearch/", docs: "https://docs.elastic.co/elasticsearch/", }, - tags: ["ai"], + tags: ["search", "analytics"], load: () => import("./elastic-search/index").then((m) => m.generate), }, ];