Skip to content
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

Divide docker-entrypoint.sh into multiple files? #522

Closed
robacarp opened this issue Aug 5, 2020 · 0 comments · Fixed by #557
Closed

Divide docker-entrypoint.sh into multiple files? #522

robacarp opened this issue Aug 5, 2020 · 0 comments · Fixed by #557
Labels
Request Request for image modification or feature

Comments

@robacarp
Copy link

robacarp commented Aug 5, 2020

Does it make sense to divide docker-entrypoint.sh into multiple files, so that the functionality encompassed can be used piecewise? Issues like #242 highlight some of the problems I've had with it doing deployments, and the proliferation of a nearly infinite series of articles on how to develop and deploy wordpress with docker indicates the pain points with the current system are affecting many people.

Converting docker-entrypoint.sh into a dispatcher script which would be shorter and easier to replace with a custom configuration could help with this. Both docker-entrypoint.sh and a customized configuration can then source and/or execute helper scripts as needed. Entrypoint becomes more readable and still obeys the principle of consistency.

The scripts would then (hopefully) be more maintainable because they focus on a single responsibility. For example, the logic which copies wordpress over can be moved to entrypoint/copy_wordpress.sh. Similarly the logic which overwrites wp-config.php with environment variable support can be entrypoint/enable_env_vars.sh.

Configuring behavior for these scripts can be implemented. If the scripts are segmented they're also easier to replace. I can provide my own entrypoint (or my own copy_wordpress) which does what I want without obliterating the rest of the entrypoint code.

Preserving as much of the configuration as possible is also helpful. Some of what docker-entrypoint.sh is doing is security focused. I'd like to be able to keep as much of that as possible while opting out of what I don't want.

Thoughts? Hate mail? 🍌s?

@wglambert wglambert added the Request Request for image modification or feature label Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants