mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #823 from mafrasil/add-trigger-dev-template
feat: add trigger.dev template
This commit is contained in:
2
apps/dokploy/public/templates/triggerdotdev.svg
Normal file
2
apps/dokploy/public/templates/triggerdotdev.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.2 KiB |
File diff suppressed because it is too large
Load Diff
107
apps/dokploy/templates/triggerdotdev/docker-compose.yml
Normal file
107
apps/dokploy/templates/triggerdotdev/docker-compose.yml
Normal file
@@ -0,0 +1,107 @@
|
||||
x-webapp-env: &webapp-env
|
||||
LOGIN_ORIGIN: &trigger-url ${TRIGGER_PROTOCOL:-http}://${TRIGGER_DOMAIN:-localhost:3040}
|
||||
APP_ORIGIN: *trigger-url
|
||||
DEV_OTEL_EXPORTER_OTLP_ENDPOINT: &trigger-otel ${TRIGGER_PROTOCOL:-http}://${TRIGGER_DOMAIN:-localhost:3040}/otel
|
||||
ELECTRIC_ORIGIN: http://electric:3000
|
||||
|
||||
x-worker-env: &worker-env
|
||||
PLATFORM_HOST: webapp
|
||||
PLATFORM_WS_PORT: 3030
|
||||
SECURE_CONNECTION: "false"
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: *trigger-otel
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
redis-data:
|
||||
|
||||
networks:
|
||||
webapp:
|
||||
|
||||
services:
|
||||
webapp:
|
||||
image: ghcr.io/triggerdotdev/trigger.dev:${TRIGGER_IMAGE_TAG:-v3}
|
||||
restart: ${RESTART_POLICY:-unless-stopped}
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
<<: *webapp-env
|
||||
ports:
|
||||
- 3000
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
networks:
|
||||
- webapp
|
||||
|
||||
postgres:
|
||||
image: postgres:${POSTGRES_IMAGE_TAG:-16}
|
||||
restart: ${RESTART_POLICY:-unless-stopped}
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data/
|
||||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- webapp
|
||||
ports:
|
||||
- 5432
|
||||
command:
|
||||
- -c
|
||||
- wal_level=logical
|
||||
|
||||
redis:
|
||||
image: redis:${REDIS_IMAGE_TAG:-7}
|
||||
restart: ${RESTART_POLICY:-unless-stopped}
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- webapp
|
||||
ports:
|
||||
- 6379
|
||||
|
||||
docker-provider:
|
||||
image: ghcr.io/triggerdotdev/provider/docker:${TRIGGER_IMAGE_TAG:-v3}
|
||||
restart: ${RESTART_POLICY:-unless-stopped}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
user: root
|
||||
networks:
|
||||
- webapp
|
||||
depends_on:
|
||||
- webapp
|
||||
ports:
|
||||
- 9020
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
<<: *worker-env
|
||||
PLATFORM_SECRET: $PROVIDER_SECRET
|
||||
|
||||
coordinator:
|
||||
image: ghcr.io/triggerdotdev/coordinator:${TRIGGER_IMAGE_TAG:-v3}
|
||||
restart: ${RESTART_POLICY:-unless-stopped}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
user: root
|
||||
networks:
|
||||
- webapp
|
||||
depends_on:
|
||||
- webapp
|
||||
ports:
|
||||
- 9020
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
<<: *worker-env
|
||||
PLATFORM_SECRET: $COORDINATOR_SECRET
|
||||
|
||||
electric:
|
||||
image: electricsql/electric:${ELECTRIC_IMAGE_TAG:-latest}
|
||||
restart: ${RESTART_POLICY:-unless-stopped}
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL}?sslmode=disable
|
||||
networks:
|
||||
- webapp
|
||||
depends_on:
|
||||
- postgres
|
||||
ports:
|
||||
- 3000
|
||||
93
apps/dokploy/templates/triggerdotdev/index.ts
Normal file
93
apps/dokploy/templates/triggerdotdev/index.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
import { Secrets } from "@/components/ui/secrets";
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateBase64,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const triggerDomain = generateRandomDomain(schema);
|
||||
|
||||
const magicLinkSecret = generateBase64(16);
|
||||
const sessionSecret = generateBase64(16);
|
||||
const encryptionKey = generateBase64(32);
|
||||
const providerSecret = generateBase64(32);
|
||||
const coordinatorSecret = generateBase64(32);
|
||||
|
||||
const dbPassword = generateBase64(24);
|
||||
const dbUser = "triggeruser";
|
||||
const dbName = "triggerdb";
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: triggerDomain,
|
||||
port: 3000,
|
||||
serviceName: "webapp",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`NODE_ENV=production`,
|
||||
`RUNTIME_PLATFORM=docker-compose`,
|
||||
`V3_ENABLED=true`,
|
||||
|
||||
`# Domain configuration`,
|
||||
`TRIGGER_DOMAIN=${triggerDomain}`,
|
||||
`TRIGGER_PROTOCOL=http`,
|
||||
|
||||
`# Database configuration with secure credentials`,
|
||||
`POSTGRES_USER=${dbUser}`,
|
||||
`POSTGRES_PASSWORD=${dbPassword}`,
|
||||
`POSTGRES_DB=${dbName}`,
|
||||
`DATABASE_URL=postgresql://${dbUser}:${dbPassword}@postgres:5432/${dbName}`,
|
||||
|
||||
`# Secrets`,
|
||||
`MAGIC_LINK_SECRET=${magicLinkSecret}`,
|
||||
`SESSION_SECRET=${sessionSecret}`,
|
||||
`ENCRYPTION_KEY=${encryptionKey}`,
|
||||
`PROVIDER_SECRET=${providerSecret}`,
|
||||
`COORDINATOR_SECRET=${coordinatorSecret}`,
|
||||
|
||||
`# TRIGGER_TELEMETRY_DISABLED=1`,
|
||||
`INTERNAL_OTEL_TRACE_DISABLED=1`,
|
||||
`INTERNAL_OTEL_TRACE_LOGGING_ENABLED=0`,
|
||||
|
||||
`DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT=300`,
|
||||
`DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT=100`,
|
||||
|
||||
`DIRECT_URL=\${DATABASE_URL}`,
|
||||
`REDIS_HOST=redis`,
|
||||
`REDIS_PORT=6379`,
|
||||
`REDIS_TLS_DISABLED=true`,
|
||||
|
||||
`# If this is set, emails that are not specified won't be able to log in`,
|
||||
`# WHITELISTED_EMAILS="authorized@yahoo.com|authorized@gmail.com"`,
|
||||
`# Accounts with these emails will become admins when signing up and get access to the admin panel`,
|
||||
`# ADMIN_EMAILS="admin@example.com|another-admin@example.com"`,
|
||||
|
||||
`# If this is set, your users will be able to log in via GitHub`,
|
||||
`# AUTH_GITHUB_CLIENT_ID=`,
|
||||
`# AUTH_GITHUB_CLIENT_SECRET=`,
|
||||
|
||||
`# E-mail settings`,
|
||||
`# Ensure the FROM_EMAIL matches what you setup with Resend.com`,
|
||||
`# If these are not set, emails will be printed to the console`,
|
||||
`# FROM_EMAIL=`,
|
||||
`# REPLY_TO_EMAIL=`,
|
||||
`# RESEND_API_KEY=`,
|
||||
|
||||
`# Worker settings`,
|
||||
`HTTP_SERVER_PORT=9020`,
|
||||
`COORDINATOR_HOST=127.0.0.1`,
|
||||
`COORDINATOR_PORT=\${HTTP_SERVER_PORT}`,
|
||||
`# REGISTRY_HOST=\${DEPLOY_REGISTRY_HOST}`,
|
||||
`# REGISTRY_NAMESPACE=\${DEPLOY_REGISTRY_NAMESPACE}`,
|
||||
];
|
||||
|
||||
return {
|
||||
envs,
|
||||
domains,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user