mkdir my-wp-project && cd my-wp-project
git clone --branch=master ssh://git@gitlab.creative-workflow.org:2222/cw-wordpress/cw-wordpress-docker.git . && rm -rf ./.git*
./scripts/init-wordpress.sh Note: For this script you need to have curl installed.
Start the default docker VM docker-machine start default.
Launch a Docker Toolbox terminal eval "$(docker-machine env default)".
./scripts/run.sh
Note: At the beginning an info will be printed containing the ip where you can access your wordpress installation. E.g.
-> starting wordpress web container on: 192.168.99.100:9999 Now follow the wordpress setup guide if you **don't want to use browser-sync**.
Note: *In the terminal where you started the docker machines you can see the requests sent from your browser.*
Note: *With ctrl+c you can stop the docker container in the terminal.*
Open a new terminal inside your project folder and run as first npm install -g gulp and then npm install. Note: If you have access errors prepend the command with sudo.
Now you can start browser-sync by typing gulp serve. This will open your standard browser with your wordpress page.
Now follow the wordpress setup guide.
Note: With Ctrl+C you can stop browser-sync in the terminal.
If you now edit e.g. the style.css in my-wp-project/wordpress/wp-content/themes/twentysixteen your browser refreshes automatically.
The browser-sync user interface is accessible via localhost:3002.
If you want to watch another or your own custom wordpress theme, change the settings in my-wp-project/gulp/config.yml and restart with gulp serve.
You can share a database dump within your repo, so you can sync development with your team mates.
./scripts/db-export.sh
./scripts/db-import.sh
./scripts/run.sh Note: At the first line ip and port for web container access will be printed.
docker-compose run web bash Note: Web, db, php and browsersync are available.
docker-compose logs web Note: Web, db, php and browsersync are available.
Attention: your database will be removed, ensure you dumped it(see above). ./scripts/clean.sh
Reloads your browser on code changes and compiles sass to css and coffee to javascript. Read more.
It have to run on your local machine because of filesystem event issues.
You can add your custom gulp tasks to the files in the folder ./gulp/*.
Read more about Gulp.
- add batch scripts for window users
- test on linux and windows
- add instruction for cw-basic-theme