[PR #1003] [MERGED] fix(automatisch): switch to official image and wire up DOMAIN to fix Bad Gateway #16311

Closed
opened 2026-07-14 23:18:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Dokploy/templates/pull/1003
Author: @Siumauricio
Created: 7/14/2026
Status: Merged
Merged: 7/14/2026
Merged by: @Siumauricio

Base: canaryHead: fix/automatisch


📝 Commits (1)

  • 3c416ea fix(automatisch): switch to official image and wire up DOMAIN to fix Bad Gateway

📊 Changes

3 files changed (+17 additions, -15 deletions)

View changed files

📝 blueprints/automatisch/docker-compose.yml (+15 -14)
📝 blueprints/automatisch/meta.json (+1 -1)
📝 blueprints/automatisch/template.toml (+1 -0)

📄 Description

Problem

Issue #97 reports a persistent "Bad gateway" when opening the URL after deploying the base Automatisch template.

The original trigger (app listening on 443 while the domain targeted 3000) was patched in #470, but the template still had several defects that break or degrade fresh deploys:

  • Unofficial, stale image: dockeriddonuts/automatisch:2.0 is a third-party mirror last pushed in Nov 2024 (Automatisch has no 2.x release — the tag is arbitrary). The official image is automatischio/automatisch, currently 0.15.0.
  • ${DOMAIN} was never defined: the compose references ${DOMAIN} for HOST, but template.toml never provided it, so it resolved empty and the app generated http://localhost:3000 URLs for the web app and webhooks.
  • Internal port leaked into generated URLs: Automatisch builds its base URL as ${PROTOCOL}://${HOST}:${PORT}, so even with a domain it produced http://<domain>:3000 links behind Traefik.
  • Migration race: the app runs knex migrate at boot but only had a bare depends_on, so on slower servers it could hit Postgres before it accepts connections and crash-loop (which surfaces as Bad Gateway).

Fix

  • Switch main + worker to the official automatischio/automatisch:0.15.0 image.
  • Add DOMAIN = "${main_domain}" to [config.env] and set API_URL/WEB_APP_URL to http://${DOMAIN} so generated URLs are correct behind the proxy.
  • Add a pg_isready healthcheck on Postgres and gate the app on service_healthy; the worker now starts after the main service (same ordering as the official compose).
  • Remove the published port (Traefik routes via the Dokploy network) and the no-op REDIS_* env vars on the Redis service.
  • Bump meta.json version to 0.15.0.

Verification

Deployed on a Dokploy instance via template import:

  • Deploy finished with status done in 133s.
  • All 4 containers (automatisch, automatisch-worker, automatisch-postgres, automatisch-redis) running.
  • Generated domain responds HTTP 200 and serves the Automatisch web app (no more Bad Gateway).

Also verified with plain docker compose up locally: migrations run, seed user created, server listens on 3000 and answers HTTP 200 from inside the network.

node build-scripts/generate-meta.js --check passes (476 templates validated).

Closes #97

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Dokploy/templates/pull/1003 **Author:** [@Siumauricio](https://github.com/Siumauricio) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@Siumauricio](https://github.com/Siumauricio) **Base:** `canary` ← **Head:** `fix/automatisch` --- ### 📝 Commits (1) - [`3c416ea`](https://github.com/Dokploy/templates/commit/3c416eaba378c6574d336fe2b2b4b16a3ac56a0f) fix(automatisch): switch to official image and wire up DOMAIN to fix Bad Gateway ### 📊 Changes **3 files changed** (+17 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `blueprints/automatisch/docker-compose.yml` (+15 -14) 📝 `blueprints/automatisch/meta.json` (+1 -1) 📝 `blueprints/automatisch/template.toml` (+1 -0) </details> ### 📄 Description ## Problem Issue #97 reports a persistent "Bad gateway" when opening the URL after deploying the base Automatisch template. The original trigger (app listening on 443 while the domain targeted 3000) was patched in #470, but the template still had several defects that break or degrade fresh deploys: - **Unofficial, stale image**: `dockeriddonuts/automatisch:2.0` is a third-party mirror last pushed in Nov 2024 (Automatisch has no 2.x release — the tag is arbitrary). The official image is `automatischio/automatisch`, currently `0.15.0`. - **`${DOMAIN}` was never defined**: the compose references `${DOMAIN}` for `HOST`, but `template.toml` never provided it, so it resolved empty and the app generated `http://localhost:3000` URLs for the web app and webhooks. - **Internal port leaked into generated URLs**: Automatisch builds its base URL as `${PROTOCOL}://${HOST}:${PORT}`, so even with a domain it produced `http://<domain>:3000` links behind Traefik. - **Migration race**: the app runs `knex migrate` at boot but only had a bare `depends_on`, so on slower servers it could hit Postgres before it accepts connections and crash-loop (which surfaces as Bad Gateway). ## Fix - Switch main + worker to the official `automatischio/automatisch:0.15.0` image. - Add `DOMAIN = "${main_domain}"` to `[config.env]` and set `API_URL`/`WEB_APP_URL` to `http://${DOMAIN}` so generated URLs are correct behind the proxy. - Add a `pg_isready` healthcheck on Postgres and gate the app on `service_healthy`; the worker now starts after the main service (same ordering as the official compose). - Remove the published port (Traefik routes via the Dokploy network) and the no-op `REDIS_*` env vars on the Redis service. - Bump `meta.json` version to `0.15.0`. ## Verification Deployed on a Dokploy instance via template import: - Deploy finished with status `done` in 133s. - All 4 containers (`automatisch`, `automatisch-worker`, `automatisch-postgres`, `automatisch-redis`) running. - Generated domain responds `HTTP 200` and serves the Automatisch web app (no more Bad Gateway). Also verified with plain `docker compose up` locally: migrations run, seed user created, server listens on 3000 and answers `HTTP 200` from inside the network. `node build-scripts/generate-meta.js --check` passes (476 templates validated). Closes #97 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-07-14 23:18:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/templates#16311