Repository navigation
Rework the compose file for Coolify with external Postgres and Redis - #5
Conversation
The server and worker now read Postgres and Redis from variables, use Coolify's generated secret and routing variables, and attach a Traefik CORS middleware whose origin regex comes from TRAEFIK_CORS_ORIGIN_REGEX. docker-compose.local.yml adds Postgres, Redis and the published port for hosts without Coolify and for the release smoke test.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb308cd21b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5648a0485
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4dfc7e3d74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| healthcheck: | ||
| test: ["CMD", "redis-cli", "ping"] | ||
| interval: 5s | ||
| test: ['CMD-SHELL', "pgrep -f 'worker:prod' > /dev/null || exit 1"] |
There was a problem hiding this comment.
Avoid matching the healthcheck shell itself
Whenever this CMD-SHELL probe runs, its own shell command line contains the literal worker:prod; BusyBox documents pgrep -f as matching the entire command line, so the probe matches its parent shell and succeeds regardless of whether the worker process exists. This makes Docker/Coolify report the worker as healthy even when it never started or has stopped while the container remains running; use a pattern absent from the probe command or check the actual worker PID.
Useful? React with 👍 / 👎.
What
upshift/docker/docker-compose.ymlnow follows the Coolify setup used for Twenty:PG_DATABASE_HOST/PORT,POSTGRES_DB,REDIS_HOST/PORT/USER/PASSWORD) instead of a hard-coded IP.SERVICE_BASE64_32_SECRETbecomesAPP_SECRET) and routes the domain to theupshiftservice (SERVICE_URL_UPSHIFT_3000).upshift-cors, takes its origin regex fromTRAEFIK_CORS_ORIGIN_REGEXand is attached withcoolify.traefik.middlewares, so no generated router name is needed.${VAR:?}, so Coolify blocks the deployment until they are set. Optional ones have defaults, because Twenty fails validation on some empty values (an emptyFRONTEND_URLfor example).ENABLE_DB_MIGRATIONS,CACHE_STORAGE_TYPE,MESSAGE_QUEUE_TYPE,POSTGRES_ADMIN_PASSWORD,EMAIL_SYSTEM_ADDRESS,IS_SIGN_UP_DISABLED,DEBUG_MODE,API_RATE_LIMITING_TTL/LIMIT.The new
docker-compose.local.ymladds Postgres, Redis and the published port..env.examplelists it inCOMPOSE_FILE, socp .env.example .env && docker compose up -dstill starts a complete stack, and the release smoke test uses it too.Coolify setup
${TRAEFIK_CORS_ORIGIN_REGEX:?}to Traefik literally.TRAEFIK_CORS_ORIGIN_REGEXas Literal: it contains$.SERVICE_USER_POSTGRES/SERVICE_PASSWORD_POSTGRESwith the external database's credentials.upshift/README.mdhas a new "Deploying with Coolify" section with the full variable table, including how to move an existing Twenty resource (keep itsSERVICE_BASE64_32_SECRET, setPOSTGRES_DBto its database).Checked
docker compose configwith the.env.examplevalues, with Coolify-style values (external hosts, multi-workspace, S3, regex unquoted), and with no values (fails on the first required variable).upshiftandworker, Postgres and Redis come from the overlay, port 3000 is published.twentycrm/twenty:v2.45.6, because pullingghcr.io/exceev-technology/upshiftwithout credentials returnedunauthorized; Coolify servers need registry credentials unless the package is public.Note
Since the cookie-session migration, Twenty answers CORS itself for the origins in
AUTH_COOKIE_ALLOWED_ORIGINSand returns 403 to cookie-authenticated POSTs from any other origin. A new workspace subdomain still has to be added to that list; the Traefik regex alone does not let it in.