frappe_docker
frappe_docker copied to clipboard
Enhance Custom Image and Tag Configuration with Environment Variables
Firstly, I want to extend my gratitude to the community for their incredible work on the Frappe project. It’s a comprehensive software that has significantly aided my learning in web application development. The efforts behind this project are evident, and I appreciate the opportunity to contribute.
Is your feature request related to a problem? Please describe.
I find that changing the image name and tag for custom applications requires manually modifying the compose.yaml
file as per the current documentation custom-apps. This process not only alters the original file but also complicates version control and file integrity.
Describe the solution you'd like
I propose allowing the image name and tag to be configurable through environment variables. This would simplify the customization process and maintain the integrity of the compose.yaml
file. The variables I suggest are:
CUSTOM_IMAGE
CUSTOM_TAG
PULL_POLICY
PUBLISH_PORT
Each of these variables would have default values corresponding to the current setup, ensuring no disruption to existing workflows with ERPNext and other applications.
Describe alternatives you've considered
Another alternative could involve creating a separate configuration file specifically for customizations, rather than directly modifying the compose.yaml
file. However, this approach may still require manual intervention and introduces the complexity of managing multiple configuration files. Using environment variables provides a more streamlined and flexible solution that aligns with standard Docker practices.
Additional context
Allowing the use of environment variables offers greater flexibility and consistency across deployments. For instance, with the proposed variables, users can easily customize the image name, tag, pull policy, and publish port without directly modifying the compose.yaml
file.
For example, to deploy without a proxy using custom image and tag names, users could utilize the following commands:
export CUSTOM_IMAGE=mycustomimage
export CUSTOM_TAG=mytag
export PULL_POLICY=always
docker compose -f compose.yaml \
-f overrides/compose.mariadb.yaml \
-f overrides/compose.redis.yaml \
-f overrides/compose.noproxy.yaml \
config > /docker/frappe/deploy/docker-compose.yml
Alternatively, users could configure these variables in a .env
file for easier management.
By incorporating these environment variables into the deployment process, users can efficiently manage their Frappe Docker configurations while ensuring consistency and ease of use. I will be submitting a pull request to incorporate these changes into the Frappe Docker project.