mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #1114 from joaotonaco/feat/template-evolution-api
feat(template): added evolution api
This commit is contained in:
commit
5899dc9394
BIN
apps/dokploy/public/templates/evolutionapi.png
Normal file
BIN
apps/dokploy/public/templates/evolutionapi.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
61
apps/dokploy/templates/evolutionapi/docker-compose.yml
Normal file
61
apps/dokploy/templates/evolutionapi/docker-compose.yml
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
services:
|
||||||
|
evolution-api:
|
||||||
|
image: atendai/evolution-api:v2.1.2
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- evolution-instances:/evolution/instances
|
||||||
|
networks:
|
||||||
|
- dokploy-network
|
||||||
|
environment:
|
||||||
|
- SERVER_URL=${SERVER_URL}
|
||||||
|
- AUTHENTICATION_TYPE=${AUTHENTICATION_TYPE}
|
||||||
|
- AUTHENTICATION_API_KEY=${AUTHENTICATION_API_KEY}
|
||||||
|
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=${AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES}
|
||||||
|
- LANGUAGE=${LANGUAGE}
|
||||||
|
- CONFIG_SESSION_PHONE_CLIENT=${CONFIG_SESSION_PHONE_CLIENT}
|
||||||
|
- CONFIG_SESSION_PHONE_NAME=${CONFIG_SESSION_PHONE_NAME}
|
||||||
|
- TELEMETRY=${TELEMETRY}
|
||||||
|
- TELEMETRY_URL=${TELEMETRY_URL}
|
||||||
|
- DATABASE_ENABLED=${DATABASE_ENABLED}
|
||||||
|
- DATABASE_PROVIDER=${DATABASE_PROVIDER}
|
||||||
|
- DATABASE_CONNECTION_URI=${DATABASE_CONNECTION_URI}
|
||||||
|
- DATABASE_SAVE_DATA_INSTANCE=${DATABASE_SAVE_DATA_INSTANCE}
|
||||||
|
- DATABASE_SAVE_DATA_NEW_MESSAGE=${DATABASE_SAVE_DATA_NEW_MESSAGE}
|
||||||
|
- DATABASE_SAVE_MESSAGE_UPDATE=${DATABASE_SAVE_MESSAGE_UPDATE}
|
||||||
|
- DATABASE_SAVE_DATA_CONTACTS=${DATABASE_SAVE_DATA_CONTACTS}
|
||||||
|
- DATABASE_SAVE_DATA_CHATS=${DATABASE_SAVE_DATA_CHATS}
|
||||||
|
- DATABASE_SAVE_DATA_LABELS=${DATABASE_SAVE_DATA_LABELS}
|
||||||
|
- DATABASE_SAVE_DATA_HISTORIC=${DATABASE_SAVE_DATA_HISTORIC}
|
||||||
|
- CACHE_REDIS_ENABLED=${CACHE_REDIS_ENABLED}
|
||||||
|
- CACHE_REDIS_URI=${CACHE_REDIS_URI}
|
||||||
|
- CACHE_REDIS_PREFIX_KEY=${CACHE_REDIS_PREFIX_KEY}
|
||||||
|
- CACHE_REDIS_SAVE_INSTANCES=${CACHE_REDIS_SAVE_INSTANCES}
|
||||||
|
|
||||||
|
evolution-postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- evolution-postgres-data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- dokploy-network
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=${POSTGRES_DATABASE}
|
||||||
|
- POSTGRES_USER=${POSTGRES_USERNAME}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
|
||||||
|
evolution-redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- evolution-redis-data:/data
|
||||||
|
networks:
|
||||||
|
- dokploy-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
dokploy-network:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
evolution-instances:
|
||||||
|
evolution-postgres-data:
|
||||||
|
evolution-redis-data:
|
59
apps/dokploy/templates/evolutionapi/index.ts
Normal file
59
apps/dokploy/templates/evolutionapi/index.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import {
|
||||||
|
type DomainSchema,
|
||||||
|
type Schema,
|
||||||
|
type Template,
|
||||||
|
generateBase64,
|
||||||
|
generatePassword,
|
||||||
|
generateRandomDomain,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
|
export function generate(schema: Schema): Template {
|
||||||
|
const mainDomain = generateRandomDomain(schema);
|
||||||
|
const apiKey = generateBase64(64);
|
||||||
|
const postgresPassword = generatePassword();
|
||||||
|
|
||||||
|
const domains: DomainSchema[] = [
|
||||||
|
{
|
||||||
|
host: mainDomain,
|
||||||
|
port: 8080,
|
||||||
|
serviceName: "evolution-api",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const envs = [
|
||||||
|
`SERVER_URL=https://${mainDomain}`,
|
||||||
|
"AUTHENTICATION_TYPE=apikey",
|
||||||
|
`AUTHENTICATION_API_KEY=${apiKey}`,
|
||||||
|
"AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true",
|
||||||
|
|
||||||
|
"LANGUAGE=en",
|
||||||
|
"CONFIG_SESSION_PHONE_CLIENT=Evolution API",
|
||||||
|
"CONFIG_SESSION_PHONE_NAME=Chrome",
|
||||||
|
"TELEMETRY=false",
|
||||||
|
"TELEMETRY_URL=",
|
||||||
|
|
||||||
|
"POSTGRES_DATABASE=evolution",
|
||||||
|
"POSTGRES_USERNAME=postgresql",
|
||||||
|
`POSTGRES_PASSWORD=${postgresPassword}`,
|
||||||
|
"DATABASE_ENABLED=true",
|
||||||
|
"DATABASE_PROVIDER=postgresql",
|
||||||
|
`DATABASE_CONNECTION_URI=postgres://postgresql:${postgresPassword}@evolution-postgres:5432/evolution`,
|
||||||
|
"DATABASE_SAVE_DATA_INSTANCE=true",
|
||||||
|
"DATABASE_SAVE_DATA_NEW_MESSAGE=true",
|
||||||
|
"DATABASE_SAVE_MESSAGE_UPDATE=true",
|
||||||
|
"DATABASE_SAVE_DATA_CONTACTS=true",
|
||||||
|
"DATABASE_SAVE_DATA_CHATS=true",
|
||||||
|
"DATABASE_SAVE_DATA_LABELS=true",
|
||||||
|
"DATABASE_SAVE_DATA_HISTORIC=true",
|
||||||
|
|
||||||
|
"CACHE_REDIS_ENABLED=true",
|
||||||
|
"CACHE_REDIS_URI=redis://evolution-redis:6379",
|
||||||
|
"CACHE_REDIS_PREFIX_KEY=evolution",
|
||||||
|
"CACHE_REDIS_SAVE_INSTANCES=true",
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
domains,
|
||||||
|
envs,
|
||||||
|
};
|
||||||
|
}
|
@ -1239,6 +1239,21 @@ export const templates: TemplateData[] = [
|
|||||||
tags: ["matrix", "communication"],
|
tags: ["matrix", "communication"],
|
||||||
load: () => import("./conduit/index").then((m) => m.generate),
|
load: () => import("./conduit/index").then((m) => m.generate),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "evolutionapi",
|
||||||
|
name: "Evolution API",
|
||||||
|
version: "v2.1.2",
|
||||||
|
description:
|
||||||
|
"Evolution API is a robust platform dedicated to empowering small businesses with limited resources, going beyond a simple messaging solution via WhatsApp.",
|
||||||
|
logo: "evolutionapi.png",
|
||||||
|
links: {
|
||||||
|
github: "https://github.com/EvolutionAPI/evolution-api",
|
||||||
|
docs: "https://doc.evolution-api.com/v2/en/get-started/introduction",
|
||||||
|
website: "https://evolution-api.com/opensource-whatsapp-api/",
|
||||||
|
},
|
||||||
|
tags: ["api", "whatsapp", "messaging"],
|
||||||
|
load: () => import("./evolutionapi/index").then((m) => m.generate),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "conduwuit",
|
id: "conduwuit",
|
||||||
name: "Conduwuit",
|
name: "Conduwuit",
|
||||||
|
Loading…
Reference in New Issue
Block a user