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.
1. Why is this change necessary?
Previously, the Docker entrypoint script lacked automated handling for environment setup, database readiness, and dependency management. This caused several issues during container startup — such as the application failing to boot if the database wasn’t ready, manual installation steps being required, and inconsistent behavior between environments (development vs production).
Additionally, the script didn’t handle Composer dependencies efficiently, leading to higher memory usage and occasional installation failures. File permissions and environment configurations also had to be manually fixed after each build or container restart.
These changes were necessary to streamline deployment, ensure reliable automated installations, and improve stability and maintainability of the containerized UVDesk setup — especially for first-time users or CI/CD environments.
2. What does this change do, exactly?
Updated the entrypoint script to automatically:
Wait for the database to be ready before installation.
Previously, the script attempted to run database migrations immediately after the container started, which often caused errors if MySQL wasn’t fully initialized.
Now, it continuously checks database readiness using
mysqladmin pingbefore proceeding, ensuring a stable installation process.Install UVDesk if not already present.
Earlier, the container assumed UVDesk was pre-installed in the mounted directory, leading to broken builds if the directory was empty.
The new script automatically runs
composer create-project uvdesk/community-skeletonwhen no installation exists, making it self-contained and easier to deploy.Manage Composer dependencies and cache clearing with increased memory limits.
Composer installation and cache-clearing steps sometimes failed due to PHP memory exhaustion in restricted container environments.
The updated script sets
COMPOSER_MEMORY_LIMIT=-1andPHP_MEMORY_LIMIT=512M, allowing Composer to complete large dependency installs and Symfony cache clears without memory-related errors.Apply correct file permissions and environment settings.
Earlier setups required manual permission adjustments, causing issues with file writes and uploads under the Apache user.
The new logic automatically fixes ownership and permissions for
/var/www/html, ensuringwww-datacan access cache, config, and upload directories securely.Defaulted environment to production mode with easy override via
.env.Previously, containers defaulted to
devmode, which enabled debugging and verbose logging — not ideal for live deployments.The update defaults to
APP_ENV=prodfor better performance and security, but still allows easy switching back todevfor testing through the.envfile.Improved readability, security, and reduced image complexity.
The older scripts contained redundant commands, unnecessary mounts, and lacked clear comments.
The refactored version simplifies the workflow, adds descriptive logging for each setup phase, and ensures a cleaner, more maintainable Docker environment suitable for both local and production use.
3. Please link to the relevant issues (if any).