What you want is definitely possible, but as with a lot of things it might take a bit of time to get it to behave in exactly the way you want.
I use a combination of Docker and a whole bunch of Bash scripts to do what I want — used to use Vagrant, but a VM like that really burned up my laptop battery.
Whenever I start a new WordPress project, I start it off with some NPM commands:
npm run docker:create-image — makes a new docker image based on the apache:php7.1 image
npm run docker:create-container — create a new container based on the image, name it, and open up the relevant ports (80 and 3306)
npm run docker:collect — collects a whole database, plugins and themes from the existing site, using SSH, based on information in env.sh
npm run docker:start — starts the docker instance
npm run docker:provision — provisions the container with the collected data, again based on env.sh in the folder root.
At this point I can run npm start to fire up browser-sync, that automatically gives me an IP and opens up a port so that other machines can visit too.
I personally combine this with webpack and browser-sync for most of the front-end stuff, but I think that's more dependant on your use case. When needed I can also log into the docker instance.
I'd really recommend messing around with all this yourself for a bit, especially the Docker bit took me a while to understand.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What you want is definitely possible, but as with a lot of things it might take a bit of time to get it to behave in exactly the way you want.
I use a combination of Docker and a whole bunch of Bash scripts to do what I want — used to use Vagrant, but a VM like that really burned up my laptop battery.
Whenever I start a new WordPress project, I start it off with some NPM commands:
npm run docker:create-image
— makes a new docker image based on the apache:php7.1 imagenpm run docker:create-container
— create a new container based on the image, name it, and open up the relevant ports (80 and 3306)npm run docker:collect
— collects a whole database, plugins and themes from the existing site, using SSH, based on information in env.shnpm run docker:start
— starts the docker instancenpm run docker:provision
— provisions the container with the collected data, again based on env.sh in the folder root.At this point I can run
npm start
to fire up browser-sync, that automatically gives me an IP and opens up a port so that other machines can visit too.I personally combine this with webpack and browser-sync for most of the front-end stuff, but I think that's more dependant on your use case. When needed I can also log into the docker instance.
I'd really recommend messing around with all this yourself for a bit, especially the Docker bit took me a while to understand.