nezhar / wordpress-docker-compose

Easy Wordpress development with Docker and Docker Compose
MIT License
1.84k stars 1.31k forks source link

add the wp-app folder to gitignore #24

Closed slhck closed 3 years ago

slhck commented 5 years ago

This is needed as otherwise one would accidentally commit the contents of wp-app after it's been installed.

nezhar commented 5 years ago

I think this should be handled by each developer, depending on their project. Do you have another proposal on how to manage files in VCS?

slhck commented 5 years ago

Hm, I think there is a bigger issue consisting of two parts:

First, the goal of this repo is to supply latest WordPress with which you can test your plugins or themes. You don't want to modify the WordPress core code, and in fact, you don't want to ever make the code part of the repository, correct? If so, then that folder should be part of the .gitignore to prevent committing core WordPress code into the repo. (Personally, I think it's also weird to run a Docker project that leaves the repository dirty after starting it once.)

Second, the configuration changes should not be committed into the repository (see also 12 factor application principle), which relates to the .env file.

I'd therefore recommend to:

I modified the branch accordingly. I fully agree there are different views on how to handle this, so please take this as a suggestion based on best practices I've come across.

nezhar commented 5 years ago

I agree with you and I like the idea but there is although something missing. We may or not be able to set the version of wp-core using the docker image, but plugins and themes will be missing. Wordpress also does not have a package manager in order to pin the versions.

There are several approaches for this using https://wpackagist.org/, but this means we have to add composer to the project, which means that we lose the update functionality and the path of integrating existing projects, as this will increase in complexity.

slhck commented 3 years ago

Closing this due to inactivity and approach.