wordup-dev / wordup-cli

Wordup is a fully integrated development platform for WordPress. Develop plugins and themes locally. Preview in the cloud. Automatic updates in WP.
GNU General Public License v3.0
118 stars 16 forks source link

Feature request: option to save db files in dir (not in volume) #28

Open simonmeggle opened 4 years ago

simonmeggle commented 4 years ago

First, thanks for your valuable work. I want to ask for the feature to have also the database files on the host disk, not in a volume. The reason for this: I find it very convenient to "init/start" a wp project and then take the whole project directory under git version control. This enables me to save any state of the wp site with a commit and to revert/branch etc. (ok, merging database files would be by pain in the ass :-) ) From my understanding, the wizard only needs to ask "store db on volume (default=yes)", an if "no", the docker-compose file must be changed in one line:

services:
  db:
    image: mariadb:10.3
    labels:
      - "wordup.dev"
    volumes:
      #- db_data:/var/lib/mysql
      - ./db_data:/var/lib/mysql
    restart: always

Regards, Simon

shry commented 4 years ago

The possibility to export the sql file, with: wordup export sql is not an option? Another option is to export the whole installation and then you could push it to git. Afterwards you could reinstall your project with wordup install --archive=/filepath

simonmeggle commented 4 years ago

Git commits could enable the user to save the complete work, restore older snapshots, work in a branch etc. To take this further, one cherry pick a bunch of commits into the branch to (lightning fast) "install" plugins into an existing project etc. Having the corresponding database files always within the commits ensures the integrity.

Committing the exported ZIP into GIT... would work, yes. But this is nothing more than "versioning binary noise". As a consequence, when you commit a big ZIP file, you always commit a lot of redundant data. (Admittedly, commiting db files is also not git friendly, this would be a compromise)

My proposal is to make this optional so that the default is still to keep the db data in the volume.

I hope that I got this across convincingly enough :-) Thanks & regards, Simon

shry commented 4 years ago

Thank you, i will consider it :)

Your use case is very special, couldn't it be easier for you to just use blank docker-compose with the a basic WordPress docker-compose.yml?