fix(docker): Update docker-compose.yml to fix broken postgress and MinIO initialization.#330
Merged
chamikaJ merged 2 commits intoWorklenz:mainfrom Sep 10, 2025
Merged
Conversation
- Extracted Postgres (db) init wrapper into `docker/db-init-wrapper.sh` to avoid Compose variable substitution issues with `$f` and ensure dos2unix + chmod run consistently. - Extracted MinIO (createbuckets) bucket creation logic into `docker/createbuckets-entrypoint.sh` for clarity and easier maintenance and prevent docker compose from trying to substitute `$i` variable. This Fixes docker substitution warnings: 'WARN[0000] The "i" variable is not set. Defaulting to a blank string.' 'WARN[0000] The "f" variable is not set. Defaulting to a blank string.' 'WARN[0000] The "f" variable is not set. Defaulting to a blank string.' Which just break migration scripts from running.
Postgres container was marked unhealthy during initialization, causing dependent services to fail before the database was ready. Increasing the `start_period` ensures healthchecks wait long enough for Postgres to install dos2unix, finish initdb and run migrations. Otherwise the healthckeck fail during init causes partial database setup that permanently bricks other dependent services.
Contributor
|
Looks good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes multiple issues with the provided docker-compose.yml setup that were preventing a clean deployment of Worklenz.
Problems identified
Problem 1
Inline init commands in Compose were triggering Docker variable substitution warnings ($i, $f), causing broken init scripts and migration failures.
So what happens here is that docker compose tries to substitute all $VARIABLE strings. So inline scripts such as:
Will have their $f replaced with empty strings that leads to:
chmod: cannot access '': No such file or directoryProblem 2
Postgres healthcheck was running too early (before initdb, dos2unix install, and migrations finished), causing the container to be marked unhealthy and dependent services to fail.
Fixes applied
docker/db-init-wrapper.sh– runs dos2unix + chmod safely without Compose substitution conflicts.docker/createbuckets-entrypoint.sh– encapsulates MinIO bucket creation logic.Should fix #325