-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestions for handling config.php with Dockerized EspoCRM #9
Comments
This is what I've come up with so far as part of the container startup to build the proper config files for Espo. <?php
$config = include("/path/to/templates/config.php");
$config['siteUrl'] = getenv('ESPOCRM_SITE_URL');
file_put_contents("/var/www/html/data/config.php", "<?php\nreturn " . var_export($config, true) . ";\n");
$configInternal = include("/path/to/templates/config-internal.php");
$configInternal['database']['host'] = getenv('ESPOCRM_DATABASE_HOST');
$configInternal['database']['dbname'] = getenv('ESPOCRM_DATABASE_NAME');
$configInternal['database']['user'] = getenv('ESPOCRM_DATABASE_USER');
$configInternal['database']['password'] = getenv('ESPOCRM_DATABASE_PASSWORD');
$configInternal['passwordSalt'] = getenv('ESPOCRM_PASSWORD_SALT');
$configInternal['cryptKey'] = getenv('ESPOCRM_CRYPT_KEY');
$configInternal['hashSecretKey'] = getenv('ESPOCRM_HASH_SECRET_KEY');
file_put_contents("/var/www/html/data/config-internal.php", "<?php\nreturn " . var_export($configInternal, true) . ";\n"); |
Hello, You can define these parameters while creating the container. Please see https://hub.docker.com/r/espocrm/espocrm under |
I found that using the method you mention resulted in Espo doing an install during container start. The install process generated new cryptKey, passwordSalt and hashSecretKey values. These values need to remain consistent between deploys to the same environment/multiple nodes in the same cluster. |
In this case, you have to create a |
Version 7 also uses config-internal.php. How can i set parameters in docker-compose for that file. |
This is automatically defined on the EspoCRM side. All items in the
|
Could you provide feedback on best practices for managing data/config.php with a docker build of EspoCRM?
This file contains configuration that needs to be persisted across a cluster of web nodes, for example, tabList and smtp settings, therefore I would like to track the file in our git repo and include it in our build of the app, but doing this with the stock docker image causes the Espo installation process to fail because the installer thinks that the app has already been installed if this file is present. Also config.php contains values like siteUrl that should not be baked into the image since it needs to be per environment.
The text was updated successfully, but these errors were encountered: