diff --git a/apps/dokploy/public/templates/convex.svg b/apps/dokploy/public/templates/convex.svg new file mode 100644 index 00000000..8622c4c0 --- /dev/null +++ b/apps/dokploy/public/templates/convex.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/dokploy/templates/convex/docker-compose.yml b/apps/dokploy/templates/convex/docker-compose.yml new file mode 100644 index 00000000..12e2b5ad --- /dev/null +++ b/apps/dokploy/templates/convex/docker-compose.yml @@ -0,0 +1,37 @@ +services: + backend: + image: ghcr.io/get-convex/convex-backend:6c974d219776b753cd23d26f4a296629ff7c2cad + ports: + - "${PORT:-3210}:3210" + - "${SITE_PROXY_PORT:-3211}:3211" + volumes: + - data:/convex/data + environment: + - INSTANCE_NAME=${INSTANCE_NAME:-} + - INSTANCE_SECRET=${INSTANCE_SECRET:-} + - CONVEX_RELEASE_VERSION_DEV=${CONVEX_RELEASE_VERSION_DEV:-} + - ACTIONS_USER_TIMEOUT_SECS=${ACTIONS_USER_TIMEOUT_SECS:-} + - CONVEX_CLOUD_ORIGIN=${CONVEX_CLOUD_ORIGIN:-http://127.0.0.1:3210} + - CONVEX_SITE_ORIGIN=${CONVEX_SITE_ORIGIN:-http://127.0.0.1:3211} + - DATABASE_URL=${DATABASE_URL:-} + - DISABLE_BEACON=${DISABLE_BEACON:-} + - REDACT_LOGS_TO_CLIENT=${REDACT_LOGS_TO_CLIENT:-} + - RUST_LOG=${RUST_LOG:-info} + - RUST_BACKTRACE=${RUST_BACKTRACE:-} + healthcheck: + test: curl -f http://localhost:3210/version + interval: 5s + start_period: 5s + + dashboard: + image: ghcr.io/get-convex/convex-dashboard:4499dd4fd7f2148687a7774599c613d052950f46 + ports: + - "${DASHBOARD_PORT:-6791}:6791" + environment: + - NEXT_PUBLIC_DEPLOYMENT_URL=${NEXT_PUBLIC_DEPLOYMENT_URL:-http://127.0.0.1:3210} + depends_on: + backend: + condition: service_healthy + +volumes: + data: diff --git a/apps/dokploy/templates/convex/index.ts b/apps/dokploy/templates/convex/index.ts new file mode 100644 index 00000000..6a112cde --- /dev/null +++ b/apps/dokploy/templates/convex/index.ts @@ -0,0 +1,38 @@ +import { + type DomainSchema, + type Schema, + type Template, + generateRandomDomain, +} from "../utils"; + +export function generate(schema: Schema): Template { + const dashboardDomain = generateRandomDomain(schema); + const backendDomain = generateRandomDomain(schema); + const actionsDomain = generateRandomDomain(schema); + + const domains: DomainSchema[] = [ + { + host: dashboardDomain, + port: 6791, + serviceName: "dashboard", + }, + { + host: backendDomain, + port: 3210, + serviceName: "backend", + }, + { + host: actionsDomain, + port: 3211, + serviceName: "backend", + }, + ]; + + const envs = [ + `NEXT_PUBLIC_DEPLOYMENT_URL=http://${backendDomain}`, + `CONVEX_CLOUD_ORIGIN=http://${backendDomain}`, + `CONVEX_SITE_ORIGIN=http://${actionsDomain}`, + ]; + + return { envs, domains }; +} diff --git a/apps/dokploy/templates/templates.ts b/apps/dokploy/templates/templates.ts index 73a1b686..527a7ab5 100644 --- a/apps/dokploy/templates/templates.ts +++ b/apps/dokploy/templates/templates.ts @@ -1498,4 +1498,19 @@ export const templates: TemplateData[] = [ tags: ["self-hosted", "productivity", "personal-use"], load: () => import("./trilium/index").then((m) => m.generate), }, + { + id: "convex", + name: "Convex", + version: "latest", + description: + "Convex is an open-source reactive database designed to make life easy for web app developers.", + logo: "convex.svg", + links: { + github: "https://github.com/get-convex/convex", + website: "https://www.convex.dev/", + docs: "https://www.convex.dev/docs", + }, + tags: ["backend", "database", "api"], + load: () => import("./convex/index").then((m) => m.generate), + }, ];