Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…29139) ### Proposed Changes This Pull Request introduces the functionality to initialize the database using an SQL dump file specified by the DB_LOAD_DUMP_SQL environment variable. Key enhancements include: * Environment Variable Addition: `DB_LOAD_DUMP_SQL` can now be set to the path of an SQL dump file, which will be imported into the database during container initialization. * Dependency Management: The loading of the SQL dump depends on the database connection details (`DB_HOST`, `DB_USERNAME`, `DB_PASSWORD`, `DB_NAME`) being correctly set. * Custom Starter Override: If a custom starter URL (`CUSTOM_STARTER_URL`) is specified, it will take precedence over the `DB_LOAD_DUMP_SQL` variable, bypassing the SQL dump import. * Script Integration: Updates to the `50-load-dump-sql.sh` script ensure that the database dump is imported if the conditions are met, with appropriate logging for success or failure. * Docker Compose Configuration: Documentation has been provided on how to set the `DB_LOAD_DUMP_SQL` variable in the `docker-compose.yml` file. This feature enhances the flexibility and ease of initializing the database with pre-existing data, improving setup efficiency for development and testing environments. Usage: On the docker-compose file you must declare the following env variables. ``` environment: - DB_HOST=db.dotcms.site - DB_USERNAME=dotcmsdbuser - DB_PASSWORD=password - DB_NAME=dotcms - DB_LOAD_DUMP_SQL=/path/to/your/dumpfile.sql volumes: - ./path/to/dumpfile.sql:/path/to/your/dumpfile.sql ``` ### Additional Info Related to #28678 (Doc Add a command to init dotCMS with a custom dat). ### Screenshots Original | Updated :-------------------------:|:-------------------------: ** original screenshot ** | ** updated screenshot ** --------- Co-authored-by: Daniel Colina <[email protected]>
- Loading branch information