Skip to content

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

Closed
@robacarp

Description

@robacarp

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    RequestRequest for image modification or feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions