mirror of
https://github.com/Dokploy/templates.git
synced 2026-07-16 04:48:50 -05:00
feat: add Trigger.dev v4 template
This commit is contained in:
245
blueprints/triggerdotdev-v4/docker-compose.yml
Normal file
245
blueprints/triggerdotdev-v4/docker-compose.yml
Normal file
@@ -0,0 +1,245 @@
|
||||
services:
|
||||
registry-init:
|
||||
image: httpd:alpine
|
||||
restart: "no"
|
||||
volumes:
|
||||
- registry-auth:/auth
|
||||
environment:
|
||||
REGISTRY_USERNAME: ${REGISTRY_USERNAME:-trigger}
|
||||
REGISTRY_PASSWORD: ${REGISTRY_PASSWORD}
|
||||
command: >
|
||||
sh -c "
|
||||
if [ ! -f /auth/htpasswd ]; then
|
||||
htpasswd -Bbc /auth/htpasswd $$REGISTRY_USERNAME $$REGISTRY_PASSWORD;
|
||||
fi
|
||||
"
|
||||
|
||||
trigger:
|
||||
image: ghcr.io/triggerdotdev/trigger.dev:${TRIGGER_IMAGE_TAG:-main}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- clickhouse
|
||||
- electric
|
||||
- minio
|
||||
- registry
|
||||
user: root
|
||||
command: sh -c "chown -R node:node /home/node/shared && exec ./scripts/entrypoint.sh"
|
||||
environment:
|
||||
REMIX_APP_PORT: 3000
|
||||
APP_ORIGIN: https://${TRIGGER_DOMAIN}
|
||||
LOGIN_ORIGIN: https://${TRIGGER_DOMAIN}
|
||||
API_ORIGIN: https://${TRIGGER_DOMAIN}
|
||||
SESSION_SECRET: ${SESSION_SECRET}
|
||||
MAGIC_LINK_SECRET: ${MAGIC_LINK_SECRET}
|
||||
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
|
||||
MANAGED_WORKER_SECRET: ${MANAGED_WORKER_SECRET}
|
||||
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-trigger}?schema=public&sslmode=disable
|
||||
DIRECT_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-trigger}?schema=public&sslmode=disable
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_TLS_DISABLED: "true"
|
||||
ELECTRIC_ORIGIN: http://electric:3000
|
||||
DEV_OTEL_EXPORTER_OTLP_ENDPOINT: https://${TRIGGER_DOMAIN}/otel
|
||||
DEPLOY_REGISTRY_HOST: ${REGISTRY_DOMAIN}
|
||||
DEPLOY_REGISTRY_NAMESPACE: ${REGISTRY_NAMESPACE:-trigger}
|
||||
DEPLOY_REGISTRY_USERNAME: ${REGISTRY_USERNAME:-trigger}
|
||||
DEPLOY_REGISTRY_PASSWORD: ${REGISTRY_PASSWORD}
|
||||
OBJECT_STORE_BASE_URL: http://minio:9000
|
||||
OBJECT_STORE_ACCESS_KEY_ID: admin
|
||||
OBJECT_STORE_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD}
|
||||
GRACEFUL_SHUTDOWN_TIMEOUT: 1000
|
||||
NODE_MAX_OLD_SPACE_SIZE: ${NODE_MAX_OLD_SPACE_SIZE:-1024}
|
||||
TRIGGER_BOOTSTRAP_ENABLED: "1"
|
||||
TRIGGER_BOOTSTRAP_WORKER_GROUP_NAME: bootstrap
|
||||
TRIGGER_BOOTSTRAP_WORKER_TOKEN_PATH: /home/node/shared/worker_token
|
||||
CLICKHOUSE_URL: http://${CLICKHOUSE_ADMIN_USER:-default}:${CLICKHOUSE_ADMIN_PASSWORD}@clickhouse:8123?secure=false
|
||||
CLICKHOUSE_LOG_LEVEL: info
|
||||
INTERNAL_OTEL_TRACE_LOGGING_ENABLED: "0"
|
||||
RUN_REPLICATION_ENABLED: "1"
|
||||
RUN_REPLICATION_CLICKHOUSE_URL: http://${CLICKHOUSE_ADMIN_USER:-default}:${CLICKHOUSE_ADMIN_PASSWORD}@clickhouse:8123
|
||||
RUN_REPLICATION_LOG_LEVEL: info
|
||||
APP_LOG_LEVEL: info
|
||||
TRIGGER_TELEMETRY_DISABLED: "0"
|
||||
WHITELISTED_EMAILS: ${WHITELISTED_EMAILS:-}
|
||||
ADMIN_EMAILS: ${ADMIN_EMAILS:-}
|
||||
DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT: ${DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT:-100}
|
||||
DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT: ${DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT:-300}
|
||||
DEV_MAX_CONCURRENT_RUNS: ${DEV_MAX_CONCURRENT_RUNS:-25}
|
||||
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-10}
|
||||
WORKER_POLL_INTERVAL: ${WORKER_POLL_INTERVAL:-1000}
|
||||
TASK_PAYLOAD_OFFLOAD_THRESHOLD: ${TASK_PAYLOAD_OFFLOAD_THRESHOLD:-524288}
|
||||
TASK_PAYLOAD_MAXIMUM_SIZE: ${TASK_PAYLOAD_MAXIMUM_SIZE:-3145728}
|
||||
BATCH_TASK_PAYLOAD_MAXIMUM_SIZE: ${BATCH_TASK_PAYLOAD_MAXIMUM_SIZE:-1000000}
|
||||
TASK_RUN_METADATA_MAXIMUM_SIZE: ${TASK_RUN_METADATA_MAXIMUM_SIZE:-262144}
|
||||
REALTIME_STREAM_MAX_LENGTH: ${REALTIME_STREAM_MAX_LENGTH:-1000}
|
||||
REALTIME_STREAM_TTL: ${REALTIME_STREAM_TTL:-86400}
|
||||
volumes:
|
||||
- shared-data:/home/node/shared
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000/healthcheck',(r)=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
postgres:
|
||||
image: postgres:14
|
||||
restart: unless-stopped
|
||||
command: ["-c", "wal_level=logical"]
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-trigger}
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-U", "postgres"]
|
||||
interval: 5s
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
electric:
|
||||
image: electricsql/electric:1.2.4
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-trigger}?schema=public&sslmode=disable
|
||||
ELECTRIC_INSECURE: "true"
|
||||
ELECTRIC_USAGE_REPORTING: "false"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/v1/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
clickhouse:
|
||||
image: bitnamilegacy/clickhouse:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
CLICKHOUSE_ADMIN_USER: ${CLICKHOUSE_ADMIN_USER:-default}
|
||||
CLICKHOUSE_ADMIN_PASSWORD: ${CLICKHOUSE_ADMIN_PASSWORD}
|
||||
volumes:
|
||||
- clickhouse-data:/bitnami/clickhouse
|
||||
- ../files/clickhouse/override.xml:/bitnami/clickhouse/etc/config.d/override.xml:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "clickhouse-client", "--host", "localhost", "--port", "9000", "--user", "${CLICKHOUSE_ADMIN_USER:-default}", "--password", "${CLICKHOUSE_ADMIN_PASSWORD}", "--query", "SELECT 1"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
registry:
|
||||
image: registry:2
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
registry-init:
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- registry-auth:/auth:ro
|
||||
- registry-data:/var/lib/registry
|
||||
environment:
|
||||
REGISTRY_AUTH: htpasswd
|
||||
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
|
||||
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:5000/"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
minio:
|
||||
image: bitnamilegacy/minio:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MINIO_ROOT_USER: admin
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
||||
MINIO_DEFAULT_BUCKETS: packets
|
||||
MINIO_BROWSER: "on"
|
||||
volumes:
|
||||
- minio-data:/bitnami/minio/data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
supervisor:
|
||||
image: ghcr.io/triggerdotdev/supervisor:${TRIGGER_IMAGE_TAG:-main}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- docker-proxy
|
||||
- trigger
|
||||
user: root
|
||||
command: sh -c "chown -R node:node /home/node/shared && exec /usr/bin/dumb-init -- pnpm run --filter supervisor start"
|
||||
environment:
|
||||
TRIGGER_API_URL: http://trigger:3000
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: http://trigger:3000/otel
|
||||
TRIGGER_WORKER_TOKEN: file:///home/node/shared/worker_token
|
||||
MANAGED_WORKER_SECRET: ${MANAGED_WORKER_SECRET}
|
||||
TRIGGER_WORKLOAD_API_DOMAIN: supervisor
|
||||
TRIGGER_WORKLOAD_API_PORT_EXTERNAL: 8020
|
||||
DOCKER_HOST: tcp://docker-proxy:2375
|
||||
DOCKER_RUNNER_NETWORKS: ${DOCKER_RUNNER_NETWORKS}
|
||||
DOCKER_AUTOREMOVE_EXITED_CONTAINERS: ${DOCKER_AUTOREMOVE_EXITED_CONTAINERS:-0}
|
||||
DOCKER_REGISTRY_URL: https://${REGISTRY_DOMAIN}
|
||||
DOCKER_REGISTRY_USERNAME: ${REGISTRY_USERNAME:-trigger}
|
||||
DOCKER_REGISTRY_PASSWORD: ${REGISTRY_PASSWORD}
|
||||
DEBUG: "1"
|
||||
ENFORCE_MACHINE_PRESETS: "1"
|
||||
TRIGGER_DEQUEUE_INTERVAL_MS: 1000
|
||||
volumes:
|
||||
- shared-data:/home/node/shared
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:8020/health', (res) => process.exit(res.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
docker-proxy:
|
||||
image: tecnativa/docker-socket-proxy:latest
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
LOG_LEVEL: info
|
||||
POST: "1"
|
||||
CONTAINERS: "1"
|
||||
IMAGES: "1"
|
||||
INFO: "1"
|
||||
NETWORKS: "1"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-z", "127.0.0.1", "2375"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 5s
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
redis-data:
|
||||
clickhouse-data:
|
||||
minio-data:
|
||||
shared-data:
|
||||
registry-data:
|
||||
registry-auth:
|
||||
63
blueprints/triggerdotdev-v4/template.yml
Normal file
63
blueprints/triggerdotdev-v4/template.yml
Normal file
@@ -0,0 +1,63 @@
|
||||
variables:
|
||||
main_domain: ${domain}
|
||||
registry_domain: ${domain}
|
||||
trigger_image_tag: main
|
||||
postgres_db: trigger
|
||||
postgres_password: ${password:32}
|
||||
session_secret: ${base64:32}
|
||||
magic_link_secret: ${base64:32}
|
||||
encryption_key: ${base64:32}
|
||||
managed_worker_secret: ${base64:32}
|
||||
minio_root_password: ${password:32}
|
||||
registry_username: trigger
|
||||
registry_password: ${password:32}
|
||||
registry_namespace: trigger
|
||||
clickhouse_admin_user: default
|
||||
clickhouse_admin_password: ${password:32}
|
||||
docker_runner_networks: set-after-first-deploy
|
||||
|
||||
config:
|
||||
domains:
|
||||
- serviceName: trigger
|
||||
port: 3000
|
||||
host: ${main_domain}
|
||||
- serviceName: registry
|
||||
port: 5000
|
||||
host: ${registry_domain}
|
||||
|
||||
env:
|
||||
TRIGGER_DOMAIN: ${main_domain}
|
||||
REGISTRY_DOMAIN: ${registry_domain}
|
||||
TRIGGER_IMAGE_TAG: ${trigger_image_tag}
|
||||
POSTGRES_DB: ${postgres_db}
|
||||
POSTGRES_PASSWORD: ${postgres_password}
|
||||
SESSION_SECRET: ${session_secret}
|
||||
MAGIC_LINK_SECRET: ${magic_link_secret}
|
||||
ENCRYPTION_KEY: ${encryption_key}
|
||||
MANAGED_WORKER_SECRET: ${managed_worker_secret}
|
||||
MINIO_ROOT_PASSWORD: ${minio_root_password}
|
||||
REGISTRY_USERNAME: ${registry_username}
|
||||
REGISTRY_PASSWORD: ${registry_password}
|
||||
REGISTRY_NAMESPACE: ${registry_namespace}
|
||||
CLICKHOUSE_ADMIN_USER: ${clickhouse_admin_user}
|
||||
CLICKHOUSE_ADMIN_PASSWORD: ${clickhouse_admin_password}
|
||||
DOCKER_RUNNER_NETWORKS: ${docker_runner_networks}
|
||||
|
||||
mounts:
|
||||
- filePath: /clickhouse/override.xml
|
||||
content: |
|
||||
<clickhouse>
|
||||
<logger>
|
||||
<level>warning</level>
|
||||
</logger>
|
||||
<mark_cache_size>524288000</mark_cache_size>
|
||||
<concurrent_threads_soft_limit_num>1</concurrent_threads_soft_limit_num>
|
||||
<profiles>
|
||||
<default>
|
||||
<max_block_size>8192</max_block_size>
|
||||
<max_download_threads>1</max_download_threads>
|
||||
<input_format_parallel_parsing>0</input_format_parallel_parsing>
|
||||
<output_format_parallel_formatting>0</output_format_parallel_formatting>
|
||||
</default>
|
||||
</profiles>
|
||||
</clickhouse>
|
||||
11
blueprints/triggerdotdev-v4/triggerdotdev-v4.svg
Normal file
11
blueprints/triggerdotdev-v4/triggerdotdev-v4.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 64" role="img" aria-label="Trigger.dev">
|
||||
<defs>
|
||||
<linearGradient id="g" x1="0" x2="1" y1="0" y2="1">
|
||||
<stop offset="0%" stop-color="#ff4f64"/>
|
||||
<stop offset="100%" stop-color="#ff8b2d"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="320" height="64" rx="12" fill="#0f172a"/>
|
||||
<path d="M22 16h32l-18 14h12L26 48h10" fill="none" stroke="url(#g)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<text x="72" y="41" fill="#f8fafc" font-family="Verdana, sans-serif" font-size="24" font-weight="700">Trigger.dev v4</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 617 B |
17
meta.json
17
meta.json
@@ -6178,6 +6178,23 @@
|
||||
"applications"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "triggerdotdev-v4",
|
||||
"name": "Trigger.dev v4",
|
||||
"version": "main",
|
||||
"description": "Trigger.dev v4 template with PostgreSQL, Redis, ElectricSQL, ClickHouse, MinIO, and private Docker registry.",
|
||||
"logo": "triggerdotdev-v4.svg",
|
||||
"links": {
|
||||
"github": "https://github.com/triggerdotdev/trigger.dev",
|
||||
"website": "https://trigger.dev/",
|
||||
"docs": "https://trigger.dev/docs"
|
||||
},
|
||||
"tags": [
|
||||
"event-driven",
|
||||
"automation",
|
||||
"workflows"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "trilium",
|
||||
"name": "Trilium",
|
||||
|
||||
Reference in New Issue
Block a user