Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken trigger.dev templates #4724

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions templates/compose/trigger-with-external-database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
- SERVICE_FQDN_TRIGGER_3000
- LOGIN_ORIGIN=$SERVICE_FQDN_TRIGGER
- APP_ORIGIN=$SERVICE_FQDN_TRIGGER
- MAGIC_LINK_SECRET=$SERVICE_PASSWORD_64_MAGIC
- ENCRYPTION_KEY=$SERVICE_PASSWORD_64_ENCRYPTION
- SESSION_SECRET=$SERVICE_PASSWORD_64_SESSION
- MAGIC_LINK_SECRET=$SERVICE_PASSWORD_32_MAGIC
- ENCRYPTION_KEY=$SERVICE_PASSWORD_32_ENCRYPTION
- SESSION_SECRET=$SERVICE_PASSWORD_32_SESSION
- DATABASE_URL=${DATABASE_URL:?}
- DIRECT_URL=${DATABASE_URL:?}
- RUNTIME_PLATFORM=docker-compose
Expand Down
16 changes: 10 additions & 6 deletions templates/compose/trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ x-common-env: &common-env
POSTGRES_USER: $SERVICE_USER_POSTGRES
POSTGRES_PASSWORD: $SERVICE_PASSWORD_POSTGRES
POSTGRES_DB: ${POSTGRES_DB:-trigger}
MAGIC_LINK_SECRET: $SERVICE_PASSWORD_64_MAGIC
SESSION_SECRET: $SERVICE_PASSWORD_64_SESSION
ENCRYPTION_KEY: $SERVICE_PASSWORD_64_ENCRYPTION
MAGIC_LINK_SECRET: $SERVICE_PASSWORD_32_MAGIC
SESSION_SECRET: $SERVICE_PASSWORD_32_SESSION
ENCRYPTION_KEY: $SERVICE_PASSWORD_32_ENCRYPTION
PROVIDER_SECRET: $SERVICE_PASSWORD_64_PROVIDER
COORDINATOR_SECRET: $SERVICE_PASSWORD_64_COORDINATOR
DATABASE_HOST: postgresql:5432
Expand All @@ -43,7 +43,7 @@ x-common-env: &common-env
LOGIN_ORIGIN: $SERVICE_FQDN_TRIGGER_3000
APP_ORIGIN: $SERVICE_FQDN_TRIGGER_3000
DEV_OTEL_EXPORTER_OTLP_ENDPOINT: $SERVICE_FQDN_TRIGGER_3000/otel
OTEL_EXPORTER_OTLP_ENDPOINT: "http://trigger:3040/otel"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

Copy link
Author

@Winne4r Winne4r Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change it will not work properly.
You can check config - 3040 is unused port. Probably earlier smbody changed DEV_OTEL_EXPORTER_OTLP_ENDPOINT to the right one, but forgot about OTEL_EXPORTER_OTLP_ENDPOINT

OTEL_EXPORTER_OTLP_ENDPOINT: $SERVICE_FQDN_TRIGGER_3000/otel
ELECTRIC_ORIGIN: http://electric:3000

services:
Expand Down Expand Up @@ -119,13 +119,16 @@ services:
PLATFORM_HOST: trigger
PLATFORM_WS_PORT: 3000
SECURE_CONNECTION: "false"
PLATFORM_SECRET: $PROVIDER_SECRET
PLATFORM_SECRET: $SERVICE_PASSWORD_64_PROVIDER
HTTP_SERVER_PORT: 9020
coordinator:
image: ghcr.io/triggerdotdev/coordinator:v3
platform: linux/amd64
volumes:
- /var/run/docker.sock:/var/run/docker.sock
user: root
ports:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not add port mappings as this is insecure.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's specific to tigger.dev.
The coordinator pulls and runs images in the root Docker network, and this behavior cannot be changed. To enable newly deployed containers to communicate with the coordinator within the trigger network, you can only map the port.

I can change it to bind only 127.0.0.1 to smthing like:

ports:
      - 127.0.0.1:9020:9020

will it help?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to restrict the port to only the host machine.

- '127.0.0.1:9020:9020'
depends_on:
trigger:
condition: service_healthy
Expand All @@ -134,7 +137,8 @@ services:
PLATFORM_HOST: trigger
PLATFORM_WS_PORT: 3000
SECURE_CONNECTION: "false"
PLATFORM_SECRET: $COORDINATOR_SECRET
PLATFORM_SECRET: $SERVICE_PASSWORD_64_COORDINATOR
HTTP_SERVER_PORT: 9020
healthcheck:
test:
- CMD-SHELL
Expand Down