Skip to content

fix(postiz): Resolve Temporal crash loop by isolating Workflow database - #800

Closed
chahat1709 wants to merge 5 commits into
Dokploy:canaryfrom
chahat1709:fix-postiz-temporal
Closed

chahat1709 wants to merge 5 commits into
Dokploy:canaryfrom
chahat1709:fix-postiz-temporal

Conversation

@chahat1709

@chahat1709 chahat1709 commented Apr 17, 2026 •

Copy link
Copy Markdown

Resolves an issue where the Temporal auto-setup script fails to start due to schema contention with the main Postiz backend. This adds a dedicated Temporal Postgres service and the Temporal Web UI for workflow monitoring.

Greptile Summary

This PR correctly isolates Temporal's schema into its own dedicated PostgreSQL instance (postiz-temporal-postgres) to fix the schema contention crash loop, and adds the Temporal Web UI for monitoring. However, the healthcheck on postiz-temporal uses tctl, which is only available in the temporalio/admin-tools image — not in temporalio/auto-setup. The container will never report healthy, and postiz-app (which depends on condition: service_healthy) will never start.

  • P1 — tctl is absent from temporalio/auto-setup:1.27.2; replace the healthcheck with a TCP probe (nc -z localhost 7233) so the dependency chain can resolve.
  • P2 — temporalio/auto-setup is officially deprecated on Docker Hub; a follow-up migration to temporalio/server + temporalio/admin-tools is recommended.

Confidence Score: 4/5

Not safe to merge as-is — the broken healthcheck prevents postiz-app from ever starting.

The architectural fix (dedicated Temporal Postgres) is correct, but the P1 healthcheck bug using a non-existent binary (tctl) in the auto-setup container will block postiz-app from starting entirely. One targeted fix to the healthcheck command is needed before this is mergeable.

blueprints/postiz/docker-compose.yml — specifically the healthcheck.test on the postiz-temporal service (line 46).

Reviews (1): Last reviewed commit: "fix(postiz): Resolve Temporal crash loop..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Copilot AI review requested due to automatic review settings April 17, 2026 12:43
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 17, 2026
@github-actions

github-actions Bot commented Apr 17, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
templates ✅ Ready (View Log) Visit Preview 64e2d72

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to stop Postiz’s Temporal component from crash-looping by isolating Temporal onto its own Postgres instance, and it introduces a Temporal Web UI service for workflow monitoring.

Changes:

  • Added dedicated Temporal services (temporalio/auto-setup, temporalio/ui) plus a separate Postgres instance for Temporal persistence.
  • Wired Postiz to Temporal via new environment variables and added depends_on health-based startup ordering.
  • Added a new persistent volume for Temporal’s database.

Comment on lines +45 to +50
healthcheck:
test: ["CMD", "tctl", "--address", "localhost:7233", "cluster", "health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

postiz-app depends on postiz-temporal being service_healthy, but the Temporal healthcheck runs tctl inside the temporalio/auto-setup container. This is relatively brittle (CLI availability/behavior changes) and differs from existing patterns in the repo (e.g. blueprints/peerdb/docker-compose.yml uses a dedicated temporalio/admin-tools container for tctl). Consider switching to a simpler healthcheck (port/grpc probe) or adding an admin-tools container for CLI-based checks so postiz-app startup doesn't get blocked by a failing healthcheck.

Copilot uses AI. Check for mistakes.
Comment thread blueprints/postiz/docker-compose.yml Outdated
restart: always
environment:
- TEMPORAL_ADDRESS=postiz-temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:8080

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

postiz-temporal-ui sets TEMPORAL_CORS_ORIGINS to http://localhost:8080, which won’t match the actual origin when deployed behind Dokploy (and may break UI/API calls due to CORS). Make this configurable (e.g., derived from ${POSTIZ_HOST} / ${domain}) or relax/remove it if not required for this setup.

Suggested change
- TEMPORAL_CORS_ORIGINS=http://localhost:8080
- TEMPORAL_CORS_ORIGINS=https://${POSTIZ_HOST}

Copilot uses AI. Check for mistakes.
Comment thread blueprints/postiz/docker-compose.yml Outdated
Comment on lines +52 to +57
postiz-temporal-ui:
image: temporalio/ui:2.30.0
restart: always
environment:
- TEMPORAL_ADDRESS=postiz-temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:8080

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

PR description says Temporal Web UI is added for monitoring, but this compose change doesn’t include any Dokploy domain/proxy configuration for postiz-temporal-ui (e.g., no corresponding [[config.domains]] entry in template.toml). As-is, the UI container will run but won’t be reachable via Dokploy without an exposed domain/port mapping.

Copilot uses AI. Check for mistakes.
Comment thread blueprints/postiz/docker-compose.yml Outdated
- POSTGRES_USER=${DB_USER}
- POSTGRES_PWD=${DB_PASSWORD}
- POSTGRES_SEEDS=postiz-temporal-postgres
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

postiz-temporal is using DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml, which is a dev-oriented dynamic config. For a deployment blueprint, this should typically use the production SQL dynamic config (consistent with e.g. blueprints/peerdb/docker-compose.yml using production-sql.yaml) to avoid enabling dev defaults in production.

Suggested change
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/production-sql.yaml

Copilot uses AI. Check for mistakes.
Comment thread blueprints/postiz/docker-compose.yml Outdated
postiz-temporal-postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "tctl", "--address", "localhost:7233", "cluster", "health"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 tctl not present in auto-setup image — healthcheck always fails

tctl is only bundled in the temporalio/admin-tools image, not in temporalio/auto-setup. The official Temporal docs state: "Together with the tctl CLI, these binaries are available in the temporalio/admin-tools Docker image." Running CMD tctl inside the postiz-temporal container will exit with "executable file not found", so the container is never marked healthy, and postiz-app (which requires condition: service_healthy) will never start — defeating the purpose of this fix.

A TCP-reachability check is the most portable alternative since you can't rely on any specific CLI being present in the auto-setup image:

Suggested change
test: ["CMD", "tctl", "--address", "localhost:7233", "cluster", "health"]
test: ["CMD-SHELL", "nc -z localhost 7233 || exit 1"]

If nc is also unavailable, a pure-shell approach works: ["CMD-SHELL", "(echo > /dev/tcp/localhost/7233) 2>/dev/null || exit 1"].

Comment thread blueprints/postiz/docker-compose.yml Outdated
condition: service_healthy

postiz-temporal:
image: temporalio/auto-setup:1.27.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 temporalio/auto-setup is deprecated

Docker Hub marks this image as: "⚠️ DEPRECATED — This image is no longer maintained and will not receive updates." The recommended replacement is temporalio/server paired with temporalio/admin-tools for schema setup, as shown in the official samples. This is fine for a quick fix, but worth tracking for a follow-up migration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment on lines +47 to +51
healthcheck:
test: ["CMD-SHELL", "tctl --address localhost:7233 cluster health || exit 1"]
interval: 10s
timeout: 5s
retries: 10

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

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

The postiz-temporal healthcheck runs tctl, but this compose file does not include a temporalio/admin-tools sidecar (and in this repo tctl is typically run from that image, e.g. blueprints/peerdb/docker-compose.yml:78-85). If tctl isn’t present in the temporalio/server image, the healthcheck will fail indefinitely and postiz-app (which depends on condition: service_healthy) will never start. Consider switching the healthcheck to a simple port/TCP probe on 7233, or add an admin-tools container and move the tctl-based healthcheck there (and depend on that instead).

Copilot uses AI. Check for mistakes.
Comment thread blueprints/postiz/docker-compose.yml Outdated
Comment on lines +41 to +43
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/production-sql.yaml
volumes:
- postiz-temporal-config:/etc/temporal/config/dynamicconfig

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

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

postiz-temporal sets DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/production-sql.yaml but mounts a brand-new named volume on /etc/temporal/config/dynamicconfig. Named volumes start empty, so this mount will mask any dynamicconfig files shipped in the image and the referenced production-sql.yaml won’t exist unless you provision it elsewhere. Either remove this volume mount (if you want the image defaults) or provide production-sql.yaml via a Dokploy mount (template.toml [[config.mounts]]) or a bind mount directory like other templates do (see blueprints/peerdb/...).

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +62
postiz-temporal-ui:
image: temporalio/ui:2.30.0
restart: always
environment:
- TEMPORAL_ADDRESS=postiz-temporal:7233
- TEMPORAL_CORS_ORIGINS=https://${POSTIZ_HOST}
depends_on:
postiz-temporal:
condition: service_healthy

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

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

This PR description says it “adds the Temporal Web UI”, but the template currently doesn’t expose postiz-temporal-ui through Dokploy (no [[config.domains]] entry exists in blueprints/postiz/template.toml). As a result the UI won’t be reachable after deployment unless Dokploy is configured manually. Consider adding a domain mapping for postiz-temporal-ui (e.g., a temporal.${domain} subdomain) or updating the PR description if the UI is intended to remain internal-only.

Copilot uses AI. Check for mistakes.
@Siumauricio

Copy link
Copy Markdown
Contributor

Automated template check 🤖

This PR's template was imported into a test Dokploy instance (using the docker-compose.yml + template.toml from the PR head) and deployed, and its configured domains were then checked over HTTP.

Result: ❌ some issues need attention

postiz

  • Deploy: error (110s)
  • Container states at failure time: postiz-app-1: created · postiz-temporal-ui-1: created · postiz-temporal-1: restarting · postiz-temporal-postgres-1: running · postiz-postgres-1: running · postiz-redis-1: running
  • Issues:
    • the deployment finished with ERROR (see log below)
  • Deploy log (tail):
Container compose-generate-virtual-bus-fpnqjm-postiz-temporal-1 Error dependency postiz-temporal failed to start
dependency failed to start: container compose-generate-virtual-bus-fpnqjm-postiz-temporal-1 is unhealthy
Error: ❌ Docker command failed
Error occurred ❌, check the logs for details.

The test service is removed automatically after verification. Happy to re-test once the PR is updated.

# Conflicts:
#	blueprints/postiz/docker-compose.yml
Copilot AI review requested due to automatic review settings July 8, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@Siumauricio

Copy link
Copy Markdown
Contributor

Closing — superseded by #851 (already merged), which added the full Temporal stack to the Postiz template. Thanks for the contribution!

@Siumauricio Siumauricio closed this Jul 8, 2026

This branch was successfully deployed

1 active deployment
Preview — 64e2d725 Deployed Jul 8, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants