Skip to content

Re-add ability to create db if it did not exist #575

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

Closed
wants to merge 5 commits into from

Conversation

pierlon
Copy link

@pierlon pierlon commented Mar 11, 2021

Removing the ability to create the WordPress database on container startup has broken environments that rely on that feature (see WordPress/gutenberg#29752 and ampproject/amp-wp#5974 as examples). Because of this change users relying on this image will now have to customize the image to add tools such as wait-for-it so that the container will wait on their MySQL container provision the database.

I'm not sure why this feature has been removed as there are no commits or comments explaining the need for the change, but I do hope this PR is accepted so that users of the image won't have to wake up to a broken environment 😄.

@pierlon
Copy link
Author

pierlon commented Mar 11, 2021

I suppose the change was in relation to not attempting to create the DB if not desired. In 9bd1b97 I've added a new env var called SKIP_DB_CREATION that will skip the attempt to create the DB.

@pierlon pierlon force-pushed the create-db-if-not-exist branch from fd9aa6d to bcb12b9 Compare March 12, 2021 19:17
@yosifkit
Copy link
Member

Copying over my comment:

Creating the database should not have been the job of the WordPress container since that means the database user has more access than it needs to store WordPress data.

Both the mysql and mariadb images have support for creating a database and user with limited access (as is done in the example WordPress stack.yml here)

@pierlon
Copy link
Author

pierlon commented Mar 12, 2021

Understood. Thanks for the clarification and updating the related docs.

@pierlon pierlon deleted the create-db-if-not-exist branch March 12, 2021 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants